------------------------------------------------------------------------------
-- user_logic.vhd - entity/architecture pair
------------------------------------------------------------------------------
--
-- ***************************************************************************
-- ** Copyright (c) 1995-2008 Xilinx, Inc.  All rights reserved.            **
-- **                                                                       **
-- ** Xilinx, Inc.                                                          **
-- ** XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"         **
-- ** AS A COURTESY TO YOU, SOLELY FOR USE IN DEVELOPING PROGRAMS AND       **
-- ** SOLUTIONS FOR XILINX DEVICES.  BY PROVIDING THIS DESIGN, CODE,        **
-- ** OR INFORMATION AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE,        **
-- ** APPLICATION OR STANDARD, XILINX IS MAKING NO REPRESENTATION           **
-- ** THAT THIS IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,     **
-- ** AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE      **
-- ** FOR YOUR IMPLEMENTATION.  XILINX EXPRESSLY DISCLAIMS ANY              **
-- ** WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE               **
-- ** IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR        **
-- ** REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF       **
-- ** INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS       **
-- ** FOR A PARTICULAR PURPOSE.                                             **
-- **                                                                       **
-- ***************************************************************************
--
------------------------------------------------------------------------------
-- Filename:          user_logic.vhd
-- Version:           1.00.a
-- Description:       User logic.
-- Date:              Mon May 31 12:24:44 2010 (by Create and Import Peripheral Wizard)
-- VHDL Standard:     VHDL'93
------------------------------------------------------------------------------
-- Naming Conventions:
--   active low signals:                    "*_n"
--   clock signals:                         "clk", "clk_div#", "clk_#x"
--   reset signals:                         "rst", "rst_n"
--   generics:                              "C_*"
--   user defined types:                    "*_TYPE"
--   state machine next state:              "*_ns"
--   state machine current state:           "*_cs"
--   combinatorial signals:                 "*_com"
--   pipelined or register delay signals:   "*_d#"
--   counter signals:                       "*cnt*"
--   clock enable signals:                  "*_ce"
--   internal version of output port:       "*_i"
--   device pins:                           "*_pin"
--   ports:                                 "- Names begin with Uppercase"
--   processes:                             "*_PROCESS"
--   component instantiations:              "<ENTITY_>I_<#|FUNC>"
------------------------------------------------------------------------------

-- DO NOT EDIT BELOW THIS LINE --------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;

library proc_common_v2_00_a;
use proc_common_v2_00_a.proc_common_pkg.all;

-- DO NOT EDIT ABOVE THIS LINE --------------------

--USER libraries added here
--library fft_core;
--use fft_core.cf_fft_256_8;
------------------------------------------------------------------------------
-- Entity section
------------------------------------------------------------------------------
-- Definition of Generics:
--   C_SLV_DWIDTH                 -- Slave interface data bus width
--   C_NUM_REG                    -- Number of software accessible registers
--
-- Definition of Ports:
--   Bus2IP_Clk                   -- Bus to IP clock
--   Bus2IP_Reset                 -- Bus to IP reset
--   Bus2IP_Data                  -- Bus to IP data bus
--   Bus2IP_BE                    -- Bus to IP byte enables
--   Bus2IP_RdCE                  -- Bus to IP read chip enable
--   Bus2IP_WrCE                  -- Bus to IP write chip enable
--   IP2Bus_Data                  -- IP to Bus data bus
--   IP2Bus_RdAck                 -- IP to Bus read transfer acknowledgement
--   IP2Bus_WrAck                 -- IP to Bus write transfer acknowledgement
--   IP2Bus_Error                 -- IP to Bus error response
------------------------------------------------------------------------------

entity user_logic is
  generic
  (
    -- ADD USER GENERICS BELOW THIS LINE ---------------
    --USER generics added here
    -- ADD USER GENERICS ABOVE THIS LINE ---------------

    -- DO NOT EDIT BELOW THIS LINE ---------------------
    -- Bus protocol parameters, do not add to or delete
    C_SLV_DWIDTH                   : integer              := 32;
    C_NUM_REG                      : integer              := 3
    -- DO NOT EDIT ABOVE THIS LINE ---------------------
  );
  port
  (
    -- ADD USER PORTS BELOW THIS LINE ------------------
    -- ADD USER PORTS ABOVE THIS LINE ------------------

    -- DO NOT EDIT BELOW THIS LINE ---------------------
    -- Bus protocol ports, do not add to or delete
    Bus2IP_Clk                     : in  std_logic;
    Bus2IP_Reset                   : in  std_logic;
    Bus2IP_Data                    : in  std_logic_vector(0 to C_SLV_DWIDTH-1);
    Bus2IP_BE                      : in  std_logic_vector(0 to C_SLV_DWIDTH/8-1);
    Bus2IP_RdCE                    : in  std_logic_vector(0 to C_NUM_REG-1);
    Bus2IP_WrCE                    : in  std_logic_vector(0 to C_NUM_REG-1);
    IP2Bus_Data                    : out std_logic_vector(0 to C_SLV_DWIDTH-1);
    IP2Bus_RdAck                   : out std_logic;
    IP2Bus_WrAck                   : out std_logic;
    IP2Bus_Error                   : out std_logic
    -- DO NOT EDIT ABOVE THIS LINE ---------------------
  );

  attribute SIGIS : string;
  attribute SIGIS of Bus2IP_Clk    : signal is "CLK";
  attribute SIGIS of Bus2IP_Reset  : signal is "RST";

end entity user_logic;

------------------------------------------------------------------------------
-- Architecture section
------------------------------------------------------------------------------

architecture IMP of user_logic is

  --USER signal declarations added here, as needed for user logic
  --XFFT_V6_0
  signal fwd_inv_we       : std_logic := '0'; --Write enable for FWD_INV (Active High) Low on operation.
  signal rfd              : std_logic;        --Ready for data (Active High): RFD is High during the load operation.
  signal start            : std_logic := '1'; --FFT start signal (Active High): START is asserted to begin the data loading and transform calculation.
  signal fwd_inv          : std_logic := '1'; --ForwardFFT='1'  InverseFFT='0'
  signal dv               : std_logic;        --Data valid (Active High): This signal is High when valid data is presented at the output.
  signal unload           : std_logic := '1'; --Result unloading (Active High): For the Burst I/O architectures, UNLOAD starts the unloading of the results in natural order.
  signal done             : std_logic;        --FFT complete strobe (Active High): DONE transitions High for one clock cycle when the transform calculation has completed.
  signal clk              : std_logic; 
  signal busy             : std_logic;        --Core activity indicator (Active High): This signal goes High while the core is computing the transform.
  signal edone            : std_logic;        --Ignorar
  signal xn_re            : std_logic_vector(7 downto 0); 
  signal xk_im            : std_logic_vector(19 downto 0); 
  signal xn_index         : std_logic_vector(10 downto 0); 
  signal xk_re            : std_logic_vector(19 downto 0); 
  signal xn_im            : std_logic_vector(7 downto 0); 
  signal xk_index         : std_logic_vector(10 downto 0);

  type estados_fft is(inicio, carga, descarga);
  signal state : estados_fft := inicio;

  --MULTIPLICADORES
  signal p1               : std_logic_VECTOR(39 downto 0);
  signal p2               : std_logic_VECTOR(39 downto 0);
  signal p3               : std_logic_VECTOR(39 downto 0);

  --MODULO
  signal rdy              : std_logic;
  signal x_in             : std_logic_vector(39 downto 0);
  signal x_out            : std_logic_vector(20 downto 0);
  
  type arr is array(0 to 27) of std_logic_vector(10 downto 0);
  signal delay : arr;
  
  type memoria is array(0 to 2047) of std_logic_vector(20 downto 0);
  signal datos : memoria;
  signal datos_fin : memoria;
  --signal indice : integer range 0 to 2047:=0;
  
  --SENO
  signal i          : integer range 0 to 1000:=0;
  type memory_type is array (0 to 999) of integer range -128 to 127; --ROM for storing the sine values generated by sine.c
  --(sen(t))signal sine       : memory_type :=(0,0,1,2,3,4,4,5,6,7,8,8,9,10,11,12,12,13,14,15,16,16,17,18,19,20,20,21,22,23,23,24,25,26,27,27,28,29,30,31,31,32,33,34,34,35,36,37,38,38,39,40,41,41,42,43,44,44,45,46,47,47,48,49,50,50,51,52,53,53,54,55,55,56,57,58,58,59,60,60,61,62,63,63,64,65,65,66,67,67,68,69,69,70,71,71,72,73,73,74,75,75,76,77,77,78,79,79,80,80,81,82,82,83,84,84,85,85,86,87,87,88,88,89,89,90,91,91,92,92,93,93,94,94,95,96,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,104,105,105,106,106,107,107,108,108,108,109,109,110,110,110,111,111,112,112,112,113,113,114,114,114,115,115,115,116,116,116,117,117,117,118,118,118,119,119,119,119,120,120,120,120,121,121,121,121,122,122,122,122,123,123,123,123,123,124,124,124,124,124,125,125,125,125,125,125,126,126,126,126,126,126,126,126,126,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,126,126,126,126,126,126,126,126,126,125,125,125,125,125,125,124,124,124,124,124,123,123,123,123,123,122,122,122,122,121,121,121,121,120,120,120,120,119,119,119,119,118,118,118,117,117,117,116,116,116,115,115,115,114,114,114,113,113,112,112,112,111,111,110,110,110,109,109,108,108,108,107,107,106,106,105,105,104,104,104,103,103,102,102,101,101,100,100,99,99,98,98,97,97,96,96,95,94,94,93,93,92,92,91,91,90,89,89,88,88,87,87,86,85,85,84,84,83,82,82,81,80,80,79,79,78,77,77,76,75,75,74,73,73,72,71,71,70,69,69,68,67,67,66,65,65,64,63,63,62,61,60,60,59,58,58,57,56,55,55,54,53,53,52,51,50,50,49,48,47,47,46,45,44,44,43,42,41,41,40,39,38,38,37,36,35,34,34,33,32,31,31,30,29,28,27,27,26,25,24,23,23,22,21,20,20,19,18,17,16,16,15,14,13,12,12,11,10,9,8,8,7,6,5,4,4,3,2,1,0,0,0,-1,-2,-3,-4,-4,-5,-6,-7,-8,-8,-9,-10,-11,-12,-12,-13,-14,-15,-16,-16,-17,-18,-19,-20,-20,-21,-22,-23,-23,-24,-25,-26,-27,-27,-28,-29,-30,-31,-31,-32,-33,-34,-34,-35,-36,-37,-38,-38,-39,-40,-41,-41,-42,-43,-44,-44,-45,-46,-47,-47,-48,-49,-50,-50,-51,-52,-53,-53,-54,-55,-55,-56,-57,-58,-58,-59,-60,-60,-61,-62,-63,-63,-64,-65,-65,-66,-67,-67,-68,-69,-69,-70,-71,-71,-72,-73,-73,-74,-75,-75,-76,-77,-77,-78,-79,-79,-80,-80,-81,-82,-82,-83,-84,-84,-85,-85,-86,-87,-87,-88,-88,-89,-89,-90,-91,-91,-92,-92,-93,-93,-94,-94,-95,-96,-96,-97,-97,-98,-98,-99,-99,-100,-100,-101,-101,-102,-102,-103,-103,-104,-104,-104,-105,-105,-106,-106,-107,-107,-108,-108,-108,-109,-109,-110,-110,-110,-111,-111,-112,-112,-112,-113,-113,-114,-114,-114,-115,-115,-115,-116,-116,-116,-117,-117,-117,-118,-118,-118,-119,-119,-119,-119,-120,-120,-120,-120,-121,-121,-121,-121,-122,-122,-122,-122,-123,-123,-123,-123,-123,-124,-124,-124,-124,-124,-125,-125,-125,-125,-125,-125,-126,-126,-126,-126,-126,-126,-126,-126,-126,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-128,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-126,-126,-126,-126,-126,-126,-126,-126,-126,-125,-125,-125,-125,-125,-125,-124,-124,-124,-124,-124,-123,-123,-123,-123,-123,-122,-122,-122,-122,-121,-121,-121,-121,-120,-120,-120,-120,-119,-119,-119,-119,-118,-118,-118,-117,-117,-117,-116,-116,-116,-115,-115,-115,-114,-114,-114,-113,-113,-112,-112,-112,-111,-111,-110,-110,-110,-109,-109,-108,-108,-108,-107,-107,-106,-106,-105,-105,-104,-104,-104,-103,-103,-102,-102,-101,-101,-100,-100,-99,-99,-98,-98,-97,-97,-96,-96,-95,-94,-94,-93,-93,-92,-92,-91,-91,-90,-89,-89,-88,-88,-87,-87,-86,-85,-85,-84,-84,-83,-82,-82,-81,-80,-80,-79,-79,-78,-77,-77,-76,-75,-75,-74,-73,-73,-72,-71,-71,-70,-69,-69,-68,-67,-67,-66,-65,-65,-64,-63,-63,-62,-61,-60,-60,-59,-58,-58,-57,-56,-55,-55,-54,-53,-53,-52,-51,-50,-50,-49,-48,-47,-47,-46,-45,-44,-44,-43,-42,-41,-41,-40,-39,-38,-38,-37,-36,-35,-34,-34,-33,-32,-31,-31,-30,-29,-28,-27,-27,-26,-25,-24,-23,-23,-22,-21,-20,-20,-19,-18,-17,-16,-16,-15,-14,-13,-12,-12,-11,-10,-9,-8,-8,-7,-6,-5,-4,-4,-3,-2,-1,0);
  --(sen(t)+sen(2t))signal sine       : memory_type :=(0,1,2,3,4,6,7,8,9,10,12,13,14,15,16,18,19,20,21,22,23,25,26,27,28,29,30,32,33,34,35,36,37,38,40,41,42,43,44,45,46,47,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,72,73,74,75,76,77,78,79,79,80,81,82,83,84,84,85,86,87,87,88,89,90,90,91,92,92,93,94,94,95,96,96,97,97,98,99,99,100,100,101,101,102,102,103,103,104,104,104,105,105,106,106,106,107,107,108,108,108,108,109,109,109,110,110,110,110,110,111,111,111,111,111,111,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,111,111,111,111,111,111,110,110,110,110,110,109,109,109,109,108,108,108,107,107,107,106,106,106,105,105,104,104,104,103,103,102,102,101,101,101,100,100,99,99,98,97,97,96,96,95,95,94,94,93,92,92,91,90,90,89,89,88,87,87,86,85,85,84,83,82,82,81,80,80,79,78,77,77,76,75,74,74,73,72,71,71,70,69,68,67,67,66,65,64,63,63,62,61,60,59,59,58,57,56,55,55,54,53,52,51,50,50,49,48,47,46,45,45,44,43,42,41,40,40,39,38,37,36,36,35,34,33,32,31,31,30,29,28,27,27,26,25,24,24,23,22,21,20,20,19,18,17,17,16,15,14,14,13,12,12,11,10,9,9,8,7,7,6,5,5,4,3,3,2,2,1,0,0,0,0,-1,-2,-2,-3,-3,-4,-4,-5,-6,-6,-7,-7,-8,-8,-9,-9,-10,-10,-10,-11,-11,-12,-12,-13,-13,-13,-14,-14,-15,-15,-15,-16,-16,-16,-17,-17,-17,-18,-18,-18,-19,-19,-19,-19,-20,-20,-20,-20,-20,-21,-21,-21,-21,-21,-22,-22,-22,-22,-22,-22,-22,-22,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-22,-22,-22,-22,-22,-22,-22,-22,-21,-21,-21,-21,-21,-21,-20,-20,-20,-20,-20,-19,-19,-19,-19,-18,-18,-18,-18,-17,-17,-17,-17,-16,-16,-16,-15,-15,-15,-14,-14,-14,-13,-13,-13,-12,-12,-12,-11,-11,-11,-10,-10,-10,-9,-9,-9,-8,-8,-7,-7,-7,-6,-6,-5,-5,-5,-4,-4,-4,-3,-3,-2,-2,-2,-1,-1,0,0,0,0,0,1,1,2,2,2,3,3,4,4,4,5,5,5,6,6,7,7,7,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,13,14,14,14,15,15,15,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,22,22,22,22,22,22,22,22,21,21,21,21,21,20,20,20,20,20,19,19,19,19,18,18,18,17,17,17,16,16,16,15,15,15,14,14,13,13,13,12,12,11,11,10,10,10,9,9,8,8,7,7,6,6,5,4,4,3,3,2,2,1,0,0,0,0,-1,-2,-2,-3,-3,-4,-5,-5,-6,-7,-7,-8,-9,-9,-10,-11,-12,-12,-13,-14,-14,-15,-16,-17,-17,-18,-19,-20,-20,-21,-22,-23,-24,-24,-25,-26,-27,-27,-28,-29,-30,-31,-31,-32,-33,-34,-35,-36,-36,-37,-38,-39,-40,-40,-41,-42,-43,-44,-45,-45,-46,-47,-48,-49,-50,-50,-51,-52,-53,-54,-55,-55,-56,-57,-58,-59,-59,-60,-61,-62,-63,-63,-64,-65,-66,-67,-67,-68,-69,-70,-71,-71,-72,-73,-74,-74,-75,-76,-77,-77,-78,-79,-80,-80,-81,-82,-82,-83,-84,-85,-85,-86,-87,-87,-88,-89,-89,-90,-90,-91,-92,-92,-93,-94,-94,-95,-95,-96,-96,-97,-97,-98,-99,-99,-100,-100,-101,-101,-101,-102,-102,-103,-103,-104,-104,-104,-105,-105,-106,-106,-106,-107,-107,-107,-108,-108,-108,-109,-109,-109,-109,-110,-110,-110,-110,-110,-111,-111,-111,-111,-111,-111,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-112,-111,-111,-111,-111,-111,-111,-110,-110,-110,-110,-110,-109,-109,-109,-108,-108,-108,-108,-107,-107,-106,-106,-106,-105,-105,-104,-104,-104,-103,-103,-102,-102,-101,-101,-100,-100,-99,-99,-98,-97,-97,-96,-96,-95,-94,-94,-93,-92,-92,-91,-90,-90,-89,-88,-87,-87,-86,-85,-84,-84,-83,-82,-81,-80,-79,-79,-78,-77,-76,-75,-74,-73,-72,-72,-71,-70,-69,-68,-67,-66,-65,-64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-48,-47,-46,-45,-44,-43,-42,-41,-40,-38,-37,-36,-35,-34,-33,-32,-30,-29,-28,-27,-26,-25,-23,-22,-21,-20,-19,-18,-16,-15,-14,-13,-12,-10,-9,-8,-7,-6,-4,-3,-2,-1);
  --(+sen(10t))signal sine       : memory_type :=(0,2,5,7,10,12,15,17,20,22,24,26,29,31,33,35,36,38,40,42,43,44,46,47,48,49,50,51,51,52,52,53,53,53,53,53,53,53,53,52,52,51,51,50,50,49,48,48,47,46,45,45,44,43,42,42,41,40,40,39,38,38,37,37,37,36,36,36,36,36,36,37,37,37,38,39,39,40,41,42,43,44,45,47,48,50,51,53,55,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,97,99,101,102,104,105,106,107,108,109,110,111,111,112,112,113,113,113,113,113,112,112,111,111,110,109,109,108,107,105,104,103,102,100,99,97,96,94,93,91,90,88,86,85,83,82,80,78,77,75,74,73,71,70,69,68,67,66,65,64,63,63,62,62,61,61,61,61,61,61,61,61,62,62,63,63,64,65,65,66,67,68,69,70,71,72,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,90,91,92,92,92,93,93,93,93,93,93,92,92,91,91,90,89,88,87,86,85,84,82,81,79,78,76,74,72,70,68,66,64,62,60,57,55,53,51,48,46,44,42,40,37,35,33,31,29,27,25,24,22,20,19,17,16,14,13,12,11,10,9,9,8,8,7,7,7,6,6,7,7,7,7,8,8,9,9,10,11,12,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,26,27,28,28,29,29,30,30,30,31,31,31,31,30,30,30,29,29,28,27,26,25,24,23,22,21,19,18,16,15,13,11,10,8,6,4,2,0,-1,-3,-5,-7,-9,-11,-13,-15,-17,-18,-20,-22,-24,-25,-27,-29,-30,-31,-33,-34,-35,-36,-37,-38,-38,-39,-39,-40,-40,-40,-40,-40,-40,-40,-40,-39,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-28,-27,-26,-24,-23,-21,-20,-18,-17,-15,-13,-12,-10,-9,-7,-6,-5,-3,-2,-1,0,0,1,2,3,4,5,5,6,6,7,7,7,7,7,7,7,6,6,5,5,4,3,2,1,0,0,-1,-2,-3,-4,-6,-7,-8,-10,-11,-12,-14,-15,-17,-18,-19,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-31,-31,-32,-32,-33,-33,-33,-33,-33,-33,-33,-33,-32,-32,-31,-30,-29,-28,-27,-26,-25,-24,-22,-21,-19,-18,-16,-14,-13,-11,-9,-7,-5,-3,-1,0,1,3,5,7,9,11,13,14,16,18,19,21,22,24,25,26,27,28,29,30,31,32,32,33,33,33,33,33,33,33,33,32,32,31,31,30,29,28,27,26,25,24,23,22,21,19,18,17,15,14,12,11,10,8,7,6,4,3,2,1,0,0,-1,-2,-3,-4,-5,-5,-6,-6,-7,-7,-7,-7,-7,-7,-7,-6,-6,-5,-5,-4,-3,-2,-1,0,0,1,2,3,5,6,7,9,10,12,13,15,17,18,20,21,23,24,26,27,28,30,31,32,33,34,35,36,37,38,39,39,40,40,40,40,40,40,40,40,39,39,38,38,37,36,35,34,33,31,30,29,27,25,24,22,20,18,17,15,13,11,9,7,5,3,1,0,-2,-4,-6,-8,-10,-11,-13,-15,-16,-18,-19,-21,-22,-23,-24,-25,-26,-27,-28,-29,-29,-30,-30,-30,-31,-31,-31,-31,-30,-30,-30,-29,-29,-28,-28,-27,-26,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-12,-11,-10,-9,-9,-8,-8,-7,-7,-7,-7,-6,-6,-7,-7,-7,-8,-8,-9,-9,-10,-11,-12,-13,-14,-16,-17,-19,-20,-22,-24,-25,-27,-29,-31,-33,-35,-37,-40,-42,-44,-46,-48,-51,-53,-55,-57,-60,-62,-64,-66,-68,-70,-72,-74,-76,-78,-79,-81,-82,-84,-85,-86,-87,-88,-89,-90,-91,-91,-92,-92,-93,-93,-93,-93,-93,-93,-92,-92,-92,-91,-90,-90,-89,-88,-87,-86,-85,-84,-83,-82,-81,-79,-78,-77,-76,-75,-74,-72,-71,-70,-69,-68,-67,-66,-65,-65,-64,-63,-63,-62,-62,-61,-61,-61,-61,-61,-61,-61,-61,-62,-62,-63,-63,-64,-65,-66,-67,-68,-69,-70,-71,-73,-74,-75,-77,-78,-80,-82,-83,-85,-86,-88,-90,-91,-93,-94,-96,-97,-99,-100,-102,-103,-104,-105,-107,-108,-109,-109,-110,-111,-111,-112,-112,-113,-113,-113,-113,-113,-112,-112,-111,-111,-110,-109,-108,-107,-106,-105,-104,-102,-101,-99,-97,-96,-94,-92,-90,-88,-86,-84,-82,-80,-78,-76,-74,-72,-70,-68,-66,-64,-62,-60,-58,-56,-55,-53,-51,-50,-48,-47,-45,-44,-43,-42,-41,-40,-39,-39,-38,-37,-37,-37,-36,-36,-36,-36,-36,-36,-37,-37,-37,-38,-38,-39,-40,-40,-41,-42,-42,-43,-44,-45,-45,-46,-47,-48,-48,-49,-50,-50,-51,-51,-52,-52,-53,-53,-53,-53,-53,-53,-53,-53,-52,-52,-51,-51,-50,-49,-48,-47,-46,-44,-43,-42,-40,-38,-36,-35,-33,-31,-29,-26,-24,-22,-20,-17,-15,-12,-10,-7,-5,-2);
  signal sine       : memory_type :=(127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  --signal sine       : memory_type :=(127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128);
  ------------------------------------------
  -- Signals for user logic slave model s/w accessible register example
  ------------------------------------------
  signal slv_reg0                       : std_logic_vector(0 to C_SLV_DWIDTH-1);
  signal slv_reg1                       : std_logic_vector(0 to C_SLV_DWIDTH-1);
  signal slv_reg2                       : std_logic_vector(0 to C_SLV_DWIDTH-1);
  signal slv_reg_write_sel              : std_logic_vector(0 to 2);
  signal slv_reg_read_sel               : std_logic_vector(0 to 2);
  signal slv_ip2bus_data                : std_logic_vector(0 to C_SLV_DWIDTH-1);
  signal slv_read_ack                   : std_logic;
  signal slv_write_ack                  : std_logic;

begin
  --USER logic implementation added here
    --Carga de valores del seno para simular entrada
    process(Bus2IP_Clk) is
    begin
    if(rising_edge(Bus2IP_Clk)) then
      xn_re(7 downto 0) <= conv_std_logic_vector(sine(i), 8);
      xn_im(7 downto 0) <= conv_std_logic_vector(0, 8);
      i <= i + 1;
      if(i = 999) then
        i <= 0;
      end if;
    end if;
  end process;

  MAIN : process(Bus2IP_Clk)
    begin
      if Bus2IP_Clk'event and Bus2IP_Clk = '0' then
        p3 <= p1 + p2;
        datos(conv_integer(delay(27))) <= x_out;
        if(delay(27) = 2047) then
          datos_fin(0) <= datos(0); datos_fin(1) <= datos(1); datos_fin(2) <= datos(2); datos_fin(3) <= datos(3); datos_fin(4) <= datos(4); datos_fin(5) <= datos(5); datos_fin(6) <= datos(6); datos_fin(7) <= datos(7); datos_fin(8) <= datos(8); datos_fin(9) <= datos(9); datos_fin(10) <= datos(10); datos_fin(11) <= datos(11); datos_fin(12) <= datos(12); datos_fin(13) <= datos(13); datos_fin(14) <= datos(14); datos_fin(15) <= datos(15); datos_fin(16) <= datos(16); datos_fin(17) <= datos(17); datos_fin(18) <= datos(18); datos_fin(19) <= datos(19); datos_fin(20) <= datos(20); datos_fin(21) <= datos(21); datos_fin(22) <= datos(22); datos_fin(23) <= datos(23); datos_fin(24) <= datos(24); datos_fin(25) <= datos(25); datos_fin(26) <= datos(26); datos_fin(27) <= datos(27); datos_fin(28) <= datos(28); datos_fin(29) <= datos(29); datos_fin(30) <= datos(30); datos_fin(31) <= datos(31); datos_fin(32) <= datos(32); 
datos_fin(33) <= datos(33); datos_fin(34) <= datos(34); datos_fin(35) <= datos(35); datos_fin(36) <= datos(36); datos_fin(37) <= datos(37); datos_fin(38) <= datos(38); datos_fin(39) <= datos(39); datos_fin(40) <= datos(40); datos_fin(41) <= datos(41); datos_fin(42) <= datos(42); datos_fin(43) <= datos(43); datos_fin(44) <= datos(44); datos_fin(45) <= datos(45); datos_fin(46) <= datos(46); datos_fin(47) <= datos(47); datos_fin(48) <= datos(48); datos_fin(49) <= datos(49); datos_fin(50) <= datos(50); datos_fin(51) <= datos(51); datos_fin(52) <= datos(52); datos_fin(53) <= datos(53); datos_fin(54) <= datos(54); datos_fin(55) <= datos(55); datos_fin(56) <= datos(56); datos_fin(57) <= datos(57); datos_fin(58) <= datos(58); datos_fin(59) <= datos(59); datos_fin(60) <= datos(60); datos_fin(61) <= datos(61); datos_fin(62) <= datos(62); datos_fin(63) <= datos(63); datos_fin(64) <= datos(64); 
datos_fin(65) <= datos(65); datos_fin(66) <= datos(66); datos_fin(67) <= datos(67); datos_fin(68) <= datos(68); datos_fin(69) <= datos(69); datos_fin(70) <= datos(70); datos_fin(71) <= datos(71); datos_fin(72) <= datos(72); datos_fin(73) <= datos(73); datos_fin(74) <= datos(74); datos_fin(75) <= datos(75); datos_fin(76) <= datos(76); datos_fin(77) <= datos(77); datos_fin(78) <= datos(78); datos_fin(79) <= datos(79); datos_fin(80) <= datos(80); datos_fin(81) <= datos(81); datos_fin(82) <= datos(82); datos_fin(83) <= datos(83); datos_fin(84) <= datos(84); datos_fin(85) <= datos(85); datos_fin(86) <= datos(86); datos_fin(87) <= datos(87); datos_fin(88) <= datos(88); datos_fin(89) <= datos(89); datos_fin(90) <= datos(90); datos_fin(91) <= datos(91); datos_fin(92) <= datos(92); datos_fin(93) <= datos(93); datos_fin(94) <= datos(94); datos_fin(95) <= datos(95); datos_fin(96) <= datos(96); 
datos_fin(97) <= datos(97); datos_fin(98) <= datos(98); datos_fin(99) <= datos(99); datos_fin(100) <= datos(100); datos_fin(101) <= datos(101); datos_fin(102) <= datos(102); datos_fin(103) <= datos(103); datos_fin(104) <= datos(104); datos_fin(105) <= datos(105); datos_fin(106) <= datos(106); datos_fin(107) <= datos(107); datos_fin(108) <= datos(108); datos_fin(109) <= datos(109); datos_fin(110) <= datos(110); datos_fin(111) <= datos(111); datos_fin(112) <= datos(112); datos_fin(113) <= datos(113); datos_fin(114) <= datos(114); datos_fin(115) <= datos(115); datos_fin(116) <= datos(116); datos_fin(117) <= datos(117); datos_fin(118) <= datos(118); datos_fin(119) <= datos(119); datos_fin(120) <= datos(120); datos_fin(121) <= datos(121); datos_fin(122) <= datos(122); datos_fin(123) <= datos(123); datos_fin(124) <= datos(124); datos_fin(125) <= datos(125); datos_fin(126) <= datos(126); datos_fin(127) <= datos(127); datos_fin(128) <= datos(128); 
datos_fin(129) <= datos(129); datos_fin(130) <= datos(130); datos_fin(131) <= datos(131); datos_fin(132) <= datos(132); datos_fin(133) <= datos(133); datos_fin(134) <= datos(134); datos_fin(135) <= datos(135); datos_fin(136) <= datos(136); datos_fin(137) <= datos(137); datos_fin(138) <= datos(138); datos_fin(139) <= datos(139); datos_fin(140) <= datos(140); datos_fin(141) <= datos(141); datos_fin(142) <= datos(142); datos_fin(143) <= datos(143); datos_fin(144) <= datos(144); datos_fin(145) <= datos(145); datos_fin(146) <= datos(146); datos_fin(147) <= datos(147); datos_fin(148) <= datos(148); datos_fin(149) <= datos(149); datos_fin(150) <= datos(150); datos_fin(151) <= datos(151); datos_fin(152) <= datos(152); datos_fin(153) <= datos(153); datos_fin(154) <= datos(154); datos_fin(155) <= datos(155); datos_fin(156) <= datos(156); datos_fin(157) <= datos(157); datos_fin(158) <= datos(158); datos_fin(159) <= datos(159); datos_fin(160) <= datos(160); 
datos_fin(161) <= datos(161); datos_fin(162) <= datos(162); datos_fin(163) <= datos(163); datos_fin(164) <= datos(164); datos_fin(165) <= datos(165); datos_fin(166) <= datos(166); datos_fin(167) <= datos(167); datos_fin(168) <= datos(168); datos_fin(169) <= datos(169); datos_fin(170) <= datos(170); datos_fin(171) <= datos(171); datos_fin(172) <= datos(172); datos_fin(173) <= datos(173); datos_fin(174) <= datos(174); datos_fin(175) <= datos(175); datos_fin(176) <= datos(176); datos_fin(177) <= datos(177); datos_fin(178) <= datos(178); datos_fin(179) <= datos(179); datos_fin(180) <= datos(180); datos_fin(181) <= datos(181); datos_fin(182) <= datos(182); datos_fin(183) <= datos(183); datos_fin(184) <= datos(184); datos_fin(185) <= datos(185); datos_fin(186) <= datos(186); datos_fin(187) <= datos(187); datos_fin(188) <= datos(188); datos_fin(189) <= datos(189); datos_fin(190) <= datos(190); datos_fin(191) <= datos(191); datos_fin(192) <= datos(192); 
datos_fin(193) <= datos(193); datos_fin(194) <= datos(194); datos_fin(195) <= datos(195); datos_fin(196) <= datos(196); datos_fin(197) <= datos(197); datos_fin(198) <= datos(198); datos_fin(199) <= datos(199); datos_fin(200) <= datos(200); datos_fin(201) <= datos(201); datos_fin(202) <= datos(202); datos_fin(203) <= datos(203); datos_fin(204) <= datos(204); datos_fin(205) <= datos(205); datos_fin(206) <= datos(206); datos_fin(207) <= datos(207); datos_fin(208) <= datos(208); datos_fin(209) <= datos(209); datos_fin(210) <= datos(210); datos_fin(211) <= datos(211); datos_fin(212) <= datos(212); datos_fin(213) <= datos(213); datos_fin(214) <= datos(214); datos_fin(215) <= datos(215); datos_fin(216) <= datos(216); datos_fin(217) <= datos(217); datos_fin(218) <= datos(218); datos_fin(219) <= datos(219); datos_fin(220) <= datos(220); datos_fin(221) <= datos(221); datos_fin(222) <= datos(222); datos_fin(223) <= datos(223); datos_fin(224) <= datos(224); 
datos_fin(225) <= datos(225); datos_fin(226) <= datos(226); datos_fin(227) <= datos(227); datos_fin(228) <= datos(228); datos_fin(229) <= datos(229); datos_fin(230) <= datos(230); datos_fin(231) <= datos(231); datos_fin(232) <= datos(232); datos_fin(233) <= datos(233); datos_fin(234) <= datos(234); datos_fin(235) <= datos(235); datos_fin(236) <= datos(236); datos_fin(237) <= datos(237); datos_fin(238) <= datos(238); datos_fin(239) <= datos(239); datos_fin(240) <= datos(240); datos_fin(241) <= datos(241); datos_fin(242) <= datos(242); datos_fin(243) <= datos(243); datos_fin(244) <= datos(244); datos_fin(245) <= datos(245); datos_fin(246) <= datos(246); datos_fin(247) <= datos(247); datos_fin(248) <= datos(248); datos_fin(249) <= datos(249); datos_fin(250) <= datos(250); datos_fin(251) <= datos(251); datos_fin(252) <= datos(252); datos_fin(253) <= datos(253); datos_fin(254) <= datos(254); datos_fin(255) <= datos(255); datos_fin(256) <= datos(256); 
datos_fin(257) <= datos(257); datos_fin(258) <= datos(258); datos_fin(259) <= datos(259); datos_fin(260) <= datos(260); datos_fin(261) <= datos(261); datos_fin(262) <= datos(262); datos_fin(263) <= datos(263); datos_fin(264) <= datos(264); datos_fin(265) <= datos(265); datos_fin(266) <= datos(266); datos_fin(267) <= datos(267); datos_fin(268) <= datos(268); datos_fin(269) <= datos(269); datos_fin(270) <= datos(270); datos_fin(271) <= datos(271); datos_fin(272) <= datos(272); datos_fin(273) <= datos(273); datos_fin(274) <= datos(274); datos_fin(275) <= datos(275); datos_fin(276) <= datos(276); datos_fin(277) <= datos(277); datos_fin(278) <= datos(278); datos_fin(279) <= datos(279); datos_fin(280) <= datos(280); datos_fin(281) <= datos(281); datos_fin(282) <= datos(282); datos_fin(283) <= datos(283); datos_fin(284) <= datos(284); datos_fin(285) <= datos(285); datos_fin(286) <= datos(286); datos_fin(287) <= datos(287); datos_fin(288) <= datos(288); 
datos_fin(289) <= datos(289); datos_fin(290) <= datos(290); datos_fin(291) <= datos(291); datos_fin(292) <= datos(292); datos_fin(293) <= datos(293); datos_fin(294) <= datos(294); datos_fin(295) <= datos(295); datos_fin(296) <= datos(296); datos_fin(297) <= datos(297); datos_fin(298) <= datos(298); datos_fin(299) <= datos(299); datos_fin(300) <= datos(300); datos_fin(301) <= datos(301); datos_fin(302) <= datos(302); datos_fin(303) <= datos(303); datos_fin(304) <= datos(304); datos_fin(305) <= datos(305); datos_fin(306) <= datos(306); datos_fin(307) <= datos(307); datos_fin(308) <= datos(308); datos_fin(309) <= datos(309); datos_fin(310) <= datos(310); datos_fin(311) <= datos(311); datos_fin(312) <= datos(312); datos_fin(313) <= datos(313); datos_fin(314) <= datos(314); datos_fin(315) <= datos(315); datos_fin(316) <= datos(316); datos_fin(317) <= datos(317); datos_fin(318) <= datos(318); datos_fin(319) <= datos(319); datos_fin(320) <= datos(320); 
datos_fin(321) <= datos(321); datos_fin(322) <= datos(322); datos_fin(323) <= datos(323); datos_fin(324) <= datos(324); datos_fin(325) <= datos(325); datos_fin(326) <= datos(326); datos_fin(327) <= datos(327); datos_fin(328) <= datos(328); datos_fin(329) <= datos(329); datos_fin(330) <= datos(330); datos_fin(331) <= datos(331); datos_fin(332) <= datos(332); datos_fin(333) <= datos(333); datos_fin(334) <= datos(334); datos_fin(335) <= datos(335); datos_fin(336) <= datos(336); datos_fin(337) <= datos(337); datos_fin(338) <= datos(338); datos_fin(339) <= datos(339); datos_fin(340) <= datos(340); datos_fin(341) <= datos(341); datos_fin(342) <= datos(342); datos_fin(343) <= datos(343); datos_fin(344) <= datos(344); datos_fin(345) <= datos(345); datos_fin(346) <= datos(346); datos_fin(347) <= datos(347); datos_fin(348) <= datos(348); datos_fin(349) <= datos(349); datos_fin(350) <= datos(350); datos_fin(351) <= datos(351); datos_fin(352) <= datos(352); 
datos_fin(353) <= datos(353); datos_fin(354) <= datos(354); datos_fin(355) <= datos(355); datos_fin(356) <= datos(356); datos_fin(357) <= datos(357); datos_fin(358) <= datos(358); datos_fin(359) <= datos(359); datos_fin(360) <= datos(360); datos_fin(361) <= datos(361); datos_fin(362) <= datos(362); datos_fin(363) <= datos(363); datos_fin(364) <= datos(364); datos_fin(365) <= datos(365); datos_fin(366) <= datos(366); datos_fin(367) <= datos(367); datos_fin(368) <= datos(368); datos_fin(369) <= datos(369); datos_fin(370) <= datos(370); datos_fin(371) <= datos(371); datos_fin(372) <= datos(372); datos_fin(373) <= datos(373); datos_fin(374) <= datos(374); datos_fin(375) <= datos(375); datos_fin(376) <= datos(376); datos_fin(377) <= datos(377); datos_fin(378) <= datos(378); datos_fin(379) <= datos(379); datos_fin(380) <= datos(380); datos_fin(381) <= datos(381); datos_fin(382) <= datos(382); datos_fin(383) <= datos(383); datos_fin(384) <= datos(384); 
datos_fin(385) <= datos(385); datos_fin(386) <= datos(386); datos_fin(387) <= datos(387); datos_fin(388) <= datos(388); datos_fin(389) <= datos(389); datos_fin(390) <= datos(390); datos_fin(391) <= datos(391); datos_fin(392) <= datos(392); datos_fin(393) <= datos(393); datos_fin(394) <= datos(394); datos_fin(395) <= datos(395); datos_fin(396) <= datos(396); datos_fin(397) <= datos(397); datos_fin(398) <= datos(398); datos_fin(399) <= datos(399); datos_fin(400) <= datos(400); datos_fin(401) <= datos(401); datos_fin(402) <= datos(402); datos_fin(403) <= datos(403); datos_fin(404) <= datos(404); datos_fin(405) <= datos(405); datos_fin(406) <= datos(406); datos_fin(407) <= datos(407); datos_fin(408) <= datos(408); datos_fin(409) <= datos(409); datos_fin(410) <= datos(410); datos_fin(411) <= datos(411); datos_fin(412) <= datos(412); datos_fin(413) <= datos(413); datos_fin(414) <= datos(414); datos_fin(415) <= datos(415); datos_fin(416) <= datos(416); 
datos_fin(417) <= datos(417); datos_fin(418) <= datos(418); datos_fin(419) <= datos(419); datos_fin(420) <= datos(420); datos_fin(421) <= datos(421); datos_fin(422) <= datos(422); datos_fin(423) <= datos(423); datos_fin(424) <= datos(424); datos_fin(425) <= datos(425); datos_fin(426) <= datos(426); datos_fin(427) <= datos(427); datos_fin(428) <= datos(428); datos_fin(429) <= datos(429); datos_fin(430) <= datos(430); datos_fin(431) <= datos(431); datos_fin(432) <= datos(432); datos_fin(433) <= datos(433); datos_fin(434) <= datos(434); datos_fin(435) <= datos(435); datos_fin(436) <= datos(436); datos_fin(437) <= datos(437); datos_fin(438) <= datos(438); datos_fin(439) <= datos(439); datos_fin(440) <= datos(440); datos_fin(441) <= datos(441); datos_fin(442) <= datos(442); datos_fin(443) <= datos(443); datos_fin(444) <= datos(444); datos_fin(445) <= datos(445); datos_fin(446) <= datos(446); datos_fin(447) <= datos(447); datos_fin(448) <= datos(448); 
datos_fin(449) <= datos(449); datos_fin(450) <= datos(450); datos_fin(451) <= datos(451); datos_fin(452) <= datos(452); datos_fin(453) <= datos(453); datos_fin(454) <= datos(454); datos_fin(455) <= datos(455); datos_fin(456) <= datos(456); datos_fin(457) <= datos(457); datos_fin(458) <= datos(458); datos_fin(459) <= datos(459); datos_fin(460) <= datos(460); datos_fin(461) <= datos(461); datos_fin(462) <= datos(462); datos_fin(463) <= datos(463); datos_fin(464) <= datos(464); datos_fin(465) <= datos(465); datos_fin(466) <= datos(466); datos_fin(467) <= datos(467); datos_fin(468) <= datos(468); datos_fin(469) <= datos(469); datos_fin(470) <= datos(470); datos_fin(471) <= datos(471); datos_fin(472) <= datos(472); datos_fin(473) <= datos(473); datos_fin(474) <= datos(474); datos_fin(475) <= datos(475); datos_fin(476) <= datos(476); datos_fin(477) <= datos(477); datos_fin(478) <= datos(478); datos_fin(479) <= datos(479); datos_fin(480) <= datos(480); 
datos_fin(481) <= datos(481); datos_fin(482) <= datos(482); datos_fin(483) <= datos(483); datos_fin(484) <= datos(484); datos_fin(485) <= datos(485); datos_fin(486) <= datos(486); datos_fin(487) <= datos(487); datos_fin(488) <= datos(488); datos_fin(489) <= datos(489); datos_fin(490) <= datos(490); datos_fin(491) <= datos(491); datos_fin(492) <= datos(492); datos_fin(493) <= datos(493); datos_fin(494) <= datos(494); datos_fin(495) <= datos(495); datos_fin(496) <= datos(496); datos_fin(497) <= datos(497); datos_fin(498) <= datos(498); datos_fin(499) <= datos(499); datos_fin(500) <= datos(500); datos_fin(501) <= datos(501); datos_fin(502) <= datos(502); datos_fin(503) <= datos(503); datos_fin(504) <= datos(504); datos_fin(505) <= datos(505); datos_fin(506) <= datos(506); datos_fin(507) <= datos(507); datos_fin(508) <= datos(508); datos_fin(509) <= datos(509); datos_fin(510) <= datos(510); datos_fin(511) <= datos(511); datos_fin(512) <= datos(512); 
datos_fin(513) <= datos(513); datos_fin(514) <= datos(514); datos_fin(515) <= datos(515); datos_fin(516) <= datos(516); datos_fin(517) <= datos(517); datos_fin(518) <= datos(518); datos_fin(519) <= datos(519); datos_fin(520) <= datos(520); datos_fin(521) <= datos(521); datos_fin(522) <= datos(522); datos_fin(523) <= datos(523); datos_fin(524) <= datos(524); datos_fin(525) <= datos(525); datos_fin(526) <= datos(526); datos_fin(527) <= datos(527); datos_fin(528) <= datos(528); datos_fin(529) <= datos(529); datos_fin(530) <= datos(530); datos_fin(531) <= datos(531); datos_fin(532) <= datos(532); datos_fin(533) <= datos(533); datos_fin(534) <= datos(534); datos_fin(535) <= datos(535); datos_fin(536) <= datos(536); datos_fin(537) <= datos(537); datos_fin(538) <= datos(538); datos_fin(539) <= datos(539); datos_fin(540) <= datos(540); datos_fin(541) <= datos(541); datos_fin(542) <= datos(542); datos_fin(543) <= datos(543); datos_fin(544) <= datos(544); 
datos_fin(545) <= datos(545); datos_fin(546) <= datos(546); datos_fin(547) <= datos(547); datos_fin(548) <= datos(548); datos_fin(549) <= datos(549); datos_fin(550) <= datos(550); datos_fin(551) <= datos(551); datos_fin(552) <= datos(552); datos_fin(553) <= datos(553); datos_fin(554) <= datos(554); datos_fin(555) <= datos(555); datos_fin(556) <= datos(556); datos_fin(557) <= datos(557); datos_fin(558) <= datos(558); datos_fin(559) <= datos(559); datos_fin(560) <= datos(560); datos_fin(561) <= datos(561); datos_fin(562) <= datos(562); datos_fin(563) <= datos(563); datos_fin(564) <= datos(564); datos_fin(565) <= datos(565); datos_fin(566) <= datos(566); datos_fin(567) <= datos(567); datos_fin(568) <= datos(568); datos_fin(569) <= datos(569); datos_fin(570) <= datos(570); datos_fin(571) <= datos(571); datos_fin(572) <= datos(572); datos_fin(573) <= datos(573); datos_fin(574) <= datos(574); datos_fin(575) <= datos(575); datos_fin(576) <= datos(576); 
datos_fin(577) <= datos(577); datos_fin(578) <= datos(578); datos_fin(579) <= datos(579); datos_fin(580) <= datos(580); datos_fin(581) <= datos(581); datos_fin(582) <= datos(582); datos_fin(583) <= datos(583); datos_fin(584) <= datos(584); datos_fin(585) <= datos(585); datos_fin(586) <= datos(586); datos_fin(587) <= datos(587); datos_fin(588) <= datos(588); datos_fin(589) <= datos(589); datos_fin(590) <= datos(590); datos_fin(591) <= datos(591); datos_fin(592) <= datos(592); datos_fin(593) <= datos(593); datos_fin(594) <= datos(594); datos_fin(595) <= datos(595); datos_fin(596) <= datos(596); datos_fin(597) <= datos(597); datos_fin(598) <= datos(598); datos_fin(599) <= datos(599); datos_fin(600) <= datos(600); datos_fin(601) <= datos(601); datos_fin(602) <= datos(602); datos_fin(603) <= datos(603); datos_fin(604) <= datos(604); datos_fin(605) <= datos(605); datos_fin(606) <= datos(606); datos_fin(607) <= datos(607); datos_fin(608) <= datos(608); 
datos_fin(609) <= datos(609); datos_fin(610) <= datos(610); datos_fin(611) <= datos(611); datos_fin(612) <= datos(612); datos_fin(613) <= datos(613); datos_fin(614) <= datos(614); datos_fin(615) <= datos(615); datos_fin(616) <= datos(616); datos_fin(617) <= datos(617); datos_fin(618) <= datos(618); datos_fin(619) <= datos(619); datos_fin(620) <= datos(620); datos_fin(621) <= datos(621); datos_fin(622) <= datos(622); datos_fin(623) <= datos(623); datos_fin(624) <= datos(624); datos_fin(625) <= datos(625); datos_fin(626) <= datos(626); datos_fin(627) <= datos(627); datos_fin(628) <= datos(628); datos_fin(629) <= datos(629); datos_fin(630) <= datos(630); datos_fin(631) <= datos(631); datos_fin(632) <= datos(632); datos_fin(633) <= datos(633); datos_fin(634) <= datos(634); datos_fin(635) <= datos(635); datos_fin(636) <= datos(636); datos_fin(637) <= datos(637); datos_fin(638) <= datos(638); datos_fin(639) <= datos(639); datos_fin(640) <= datos(640); 
datos_fin(641) <= datos(641); datos_fin(642) <= datos(642); datos_fin(643) <= datos(643); datos_fin(644) <= datos(644); datos_fin(645) <= datos(645); datos_fin(646) <= datos(646); datos_fin(647) <= datos(647); datos_fin(648) <= datos(648); datos_fin(649) <= datos(649); datos_fin(650) <= datos(650); datos_fin(651) <= datos(651); datos_fin(652) <= datos(652); datos_fin(653) <= datos(653); datos_fin(654) <= datos(654); datos_fin(655) <= datos(655); datos_fin(656) <= datos(656); datos_fin(657) <= datos(657); datos_fin(658) <= datos(658); datos_fin(659) <= datos(659); datos_fin(660) <= datos(660); datos_fin(661) <= datos(661); datos_fin(662) <= datos(662); datos_fin(663) <= datos(663); datos_fin(664) <= datos(664); datos_fin(665) <= datos(665); datos_fin(666) <= datos(666); datos_fin(667) <= datos(667); datos_fin(668) <= datos(668); datos_fin(669) <= datos(669); datos_fin(670) <= datos(670); datos_fin(671) <= datos(671); datos_fin(672) <= datos(672); 
datos_fin(673) <= datos(673); datos_fin(674) <= datos(674); datos_fin(675) <= datos(675); datos_fin(676) <= datos(676); datos_fin(677) <= datos(677); datos_fin(678) <= datos(678); datos_fin(679) <= datos(679); datos_fin(680) <= datos(680); datos_fin(681) <= datos(681); datos_fin(682) <= datos(682); datos_fin(683) <= datos(683); datos_fin(684) <= datos(684); datos_fin(685) <= datos(685); datos_fin(686) <= datos(686); datos_fin(687) <= datos(687); datos_fin(688) <= datos(688); datos_fin(689) <= datos(689); datos_fin(690) <= datos(690); datos_fin(691) <= datos(691); datos_fin(692) <= datos(692); datos_fin(693) <= datos(693); datos_fin(694) <= datos(694); datos_fin(695) <= datos(695); datos_fin(696) <= datos(696); datos_fin(697) <= datos(697); datos_fin(698) <= datos(698); datos_fin(699) <= datos(699); datos_fin(700) <= datos(700); datos_fin(701) <= datos(701); datos_fin(702) <= datos(702); datos_fin(703) <= datos(703); datos_fin(704) <= datos(704); 
datos_fin(705) <= datos(705); datos_fin(706) <= datos(706); datos_fin(707) <= datos(707); datos_fin(708) <= datos(708); datos_fin(709) <= datos(709); datos_fin(710) <= datos(710); datos_fin(711) <= datos(711); datos_fin(712) <= datos(712); datos_fin(713) <= datos(713); datos_fin(714) <= datos(714); datos_fin(715) <= datos(715); datos_fin(716) <= datos(716); datos_fin(717) <= datos(717); datos_fin(718) <= datos(718); datos_fin(719) <= datos(719); datos_fin(720) <= datos(720); datos_fin(721) <= datos(721); datos_fin(722) <= datos(722); datos_fin(723) <= datos(723); datos_fin(724) <= datos(724); datos_fin(725) <= datos(725); datos_fin(726) <= datos(726); datos_fin(727) <= datos(727); datos_fin(728) <= datos(728); datos_fin(729) <= datos(729); datos_fin(730) <= datos(730); datos_fin(731) <= datos(731); datos_fin(732) <= datos(732); datos_fin(733) <= datos(733); datos_fin(734) <= datos(734); datos_fin(735) <= datos(735); datos_fin(736) <= datos(736); 
datos_fin(737) <= datos(737); datos_fin(738) <= datos(738); datos_fin(739) <= datos(739); datos_fin(740) <= datos(740); datos_fin(741) <= datos(741); datos_fin(742) <= datos(742); datos_fin(743) <= datos(743); datos_fin(744) <= datos(744); datos_fin(745) <= datos(745); datos_fin(746) <= datos(746); datos_fin(747) <= datos(747); datos_fin(748) <= datos(748); datos_fin(749) <= datos(749); datos_fin(750) <= datos(750); datos_fin(751) <= datos(751); datos_fin(752) <= datos(752); datos_fin(753) <= datos(753); datos_fin(754) <= datos(754); datos_fin(755) <= datos(755); datos_fin(756) <= datos(756); datos_fin(757) <= datos(757); datos_fin(758) <= datos(758); datos_fin(759) <= datos(759); datos_fin(760) <= datos(760); datos_fin(761) <= datos(761); datos_fin(762) <= datos(762); datos_fin(763) <= datos(763); datos_fin(764) <= datos(764); datos_fin(765) <= datos(765); datos_fin(766) <= datos(766); datos_fin(767) <= datos(767); datos_fin(768) <= datos(768); 
datos_fin(769) <= datos(769); datos_fin(770) <= datos(770); datos_fin(771) <= datos(771); datos_fin(772) <= datos(772); datos_fin(773) <= datos(773); datos_fin(774) <= datos(774); datos_fin(775) <= datos(775); datos_fin(776) <= datos(776); datos_fin(777) <= datos(777); datos_fin(778) <= datos(778); datos_fin(779) <= datos(779); datos_fin(780) <= datos(780); datos_fin(781) <= datos(781); datos_fin(782) <= datos(782); datos_fin(783) <= datos(783); datos_fin(784) <= datos(784); datos_fin(785) <= datos(785); datos_fin(786) <= datos(786); datos_fin(787) <= datos(787); datos_fin(788) <= datos(788); datos_fin(789) <= datos(789); datos_fin(790) <= datos(790); datos_fin(791) <= datos(791); datos_fin(792) <= datos(792); datos_fin(793) <= datos(793); datos_fin(794) <= datos(794); datos_fin(795) <= datos(795); datos_fin(796) <= datos(796); datos_fin(797) <= datos(797); datos_fin(798) <= datos(798); datos_fin(799) <= datos(799); datos_fin(800) <= datos(800); 
datos_fin(801) <= datos(801); datos_fin(802) <= datos(802); datos_fin(803) <= datos(803); datos_fin(804) <= datos(804); datos_fin(805) <= datos(805); datos_fin(806) <= datos(806); datos_fin(807) <= datos(807); datos_fin(808) <= datos(808); datos_fin(809) <= datos(809); datos_fin(810) <= datos(810); datos_fin(811) <= datos(811); datos_fin(812) <= datos(812); datos_fin(813) <= datos(813); datos_fin(814) <= datos(814); datos_fin(815) <= datos(815); datos_fin(816) <= datos(816); datos_fin(817) <= datos(817); datos_fin(818) <= datos(818); datos_fin(819) <= datos(819); datos_fin(820) <= datos(820); datos_fin(821) <= datos(821); datos_fin(822) <= datos(822); datos_fin(823) <= datos(823); datos_fin(824) <= datos(824); datos_fin(825) <= datos(825); datos_fin(826) <= datos(826); datos_fin(827) <= datos(827); datos_fin(828) <= datos(828); datos_fin(829) <= datos(829); datos_fin(830) <= datos(830); datos_fin(831) <= datos(831); datos_fin(832) <= datos(832); 
datos_fin(833) <= datos(833); datos_fin(834) <= datos(834); datos_fin(835) <= datos(835); datos_fin(836) <= datos(836); datos_fin(837) <= datos(837); datos_fin(838) <= datos(838); datos_fin(839) <= datos(839); datos_fin(840) <= datos(840); datos_fin(841) <= datos(841); datos_fin(842) <= datos(842); datos_fin(843) <= datos(843); datos_fin(844) <= datos(844); datos_fin(845) <= datos(845); datos_fin(846) <= datos(846); datos_fin(847) <= datos(847); datos_fin(848) <= datos(848); datos_fin(849) <= datos(849); datos_fin(850) <= datos(850); datos_fin(851) <= datos(851); datos_fin(852) <= datos(852); datos_fin(853) <= datos(853); datos_fin(854) <= datos(854); datos_fin(855) <= datos(855); datos_fin(856) <= datos(856); datos_fin(857) <= datos(857); datos_fin(858) <= datos(858); datos_fin(859) <= datos(859); datos_fin(860) <= datos(860); datos_fin(861) <= datos(861); datos_fin(862) <= datos(862); datos_fin(863) <= datos(863); datos_fin(864) <= datos(864); 
datos_fin(865) <= datos(865); datos_fin(866) <= datos(866); datos_fin(867) <= datos(867); datos_fin(868) <= datos(868); datos_fin(869) <= datos(869); datos_fin(870) <= datos(870); datos_fin(871) <= datos(871); datos_fin(872) <= datos(872); datos_fin(873) <= datos(873); datos_fin(874) <= datos(874); datos_fin(875) <= datos(875); datos_fin(876) <= datos(876); datos_fin(877) <= datos(877); datos_fin(878) <= datos(878); datos_fin(879) <= datos(879); datos_fin(880) <= datos(880); datos_fin(881) <= datos(881); datos_fin(882) <= datos(882); datos_fin(883) <= datos(883); datos_fin(884) <= datos(884); datos_fin(885) <= datos(885); datos_fin(886) <= datos(886); datos_fin(887) <= datos(887); datos_fin(888) <= datos(888); datos_fin(889) <= datos(889); datos_fin(890) <= datos(890); datos_fin(891) <= datos(891); datos_fin(892) <= datos(892); datos_fin(893) <= datos(893); datos_fin(894) <= datos(894); datos_fin(895) <= datos(895); datos_fin(896) <= datos(896); 
datos_fin(897) <= datos(897); datos_fin(898) <= datos(898); datos_fin(899) <= datos(899); datos_fin(900) <= datos(900); datos_fin(901) <= datos(901); datos_fin(902) <= datos(902); datos_fin(903) <= datos(903); datos_fin(904) <= datos(904); datos_fin(905) <= datos(905); datos_fin(906) <= datos(906); datos_fin(907) <= datos(907); datos_fin(908) <= datos(908); datos_fin(909) <= datos(909); datos_fin(910) <= datos(910); datos_fin(911) <= datos(911); datos_fin(912) <= datos(912); datos_fin(913) <= datos(913); datos_fin(914) <= datos(914); datos_fin(915) <= datos(915); datos_fin(916) <= datos(916); datos_fin(917) <= datos(917); datos_fin(918) <= datos(918); datos_fin(919) <= datos(919); datos_fin(920) <= datos(920); datos_fin(921) <= datos(921); datos_fin(922) <= datos(922); datos_fin(923) <= datos(923); datos_fin(924) <= datos(924); datos_fin(925) <= datos(925); datos_fin(926) <= datos(926); datos_fin(927) <= datos(927); datos_fin(928) <= datos(928); 
datos_fin(929) <= datos(929); datos_fin(930) <= datos(930); datos_fin(931) <= datos(931); datos_fin(932) <= datos(932); datos_fin(933) <= datos(933); datos_fin(934) <= datos(934); datos_fin(935) <= datos(935); datos_fin(936) <= datos(936); datos_fin(937) <= datos(937); datos_fin(938) <= datos(938); datos_fin(939) <= datos(939); datos_fin(940) <= datos(940); datos_fin(941) <= datos(941); datos_fin(942) <= datos(942); datos_fin(943) <= datos(943); datos_fin(944) <= datos(944); datos_fin(945) <= datos(945); datos_fin(946) <= datos(946); datos_fin(947) <= datos(947); datos_fin(948) <= datos(948); datos_fin(949) <= datos(949); datos_fin(950) <= datos(950); datos_fin(951) <= datos(951); datos_fin(952) <= datos(952); datos_fin(953) <= datos(953); datos_fin(954) <= datos(954); datos_fin(955) <= datos(955); datos_fin(956) <= datos(956); datos_fin(957) <= datos(957); datos_fin(958) <= datos(958); datos_fin(959) <= datos(959); datos_fin(960) <= datos(960); 
datos_fin(961) <= datos(961); datos_fin(962) <= datos(962); datos_fin(963) <= datos(963); datos_fin(964) <= datos(964); datos_fin(965) <= datos(965); datos_fin(966) <= datos(966); datos_fin(967) <= datos(967); datos_fin(968) <= datos(968); datos_fin(969) <= datos(969); datos_fin(970) <= datos(970); datos_fin(971) <= datos(971); datos_fin(972) <= datos(972); datos_fin(973) <= datos(973); datos_fin(974) <= datos(974); datos_fin(975) <= datos(975); datos_fin(976) <= datos(976); datos_fin(977) <= datos(977); datos_fin(978) <= datos(978); datos_fin(979) <= datos(979); datos_fin(980) <= datos(980); datos_fin(981) <= datos(981); datos_fin(982) <= datos(982); datos_fin(983) <= datos(983); datos_fin(984) <= datos(984); datos_fin(985) <= datos(985); datos_fin(986) <= datos(986); datos_fin(987) <= datos(987); datos_fin(988) <= datos(988); datos_fin(989) <= datos(989); datos_fin(990) <= datos(990); datos_fin(991) <= datos(991); datos_fin(992) <= datos(992); 
datos_fin(993) <= datos(993); datos_fin(994) <= datos(994); datos_fin(995) <= datos(995); datos_fin(996) <= datos(996); datos_fin(997) <= datos(997); datos_fin(998) <= datos(998); datos_fin(999) <= datos(999); datos_fin(1000) <= datos(1000); datos_fin(1001) <= datos(1001); datos_fin(1002) <= datos(1002); datos_fin(1003) <= datos(1003); datos_fin(1004) <= datos(1004); datos_fin(1005) <= datos(1005); datos_fin(1006) <= datos(1006); datos_fin(1007) <= datos(1007); datos_fin(1008) <= datos(1008); datos_fin(1009) <= datos(1009); datos_fin(1010) <= datos(1010); datos_fin(1011) <= datos(1011); datos_fin(1012) <= datos(1012); datos_fin(1013) <= datos(1013); datos_fin(1014) <= datos(1014); datos_fin(1015) <= datos(1015); datos_fin(1016) <= datos(1016); datos_fin(1017) <= datos(1017); datos_fin(1018) <= datos(1018); datos_fin(1019) <= datos(1019); datos_fin(1020) <= datos(1020); datos_fin(1021) <= datos(1021); datos_fin(1022) <= datos(1022); datos_fin(1023) <= datos(1023); datos_fin(1024) <= datos(1024); 
datos_fin(1025) <= datos(1025); datos_fin(1026) <= datos(1026); datos_fin(1027) <= datos(1027); datos_fin(1028) <= datos(1028); datos_fin(1029) <= datos(1029); datos_fin(1030) <= datos(1030); datos_fin(1031) <= datos(1031); datos_fin(1032) <= datos(1032); datos_fin(1033) <= datos(1033); datos_fin(1034) <= datos(1034); datos_fin(1035) <= datos(1035); datos_fin(1036) <= datos(1036); datos_fin(1037) <= datos(1037); datos_fin(1038) <= datos(1038); datos_fin(1039) <= datos(1039); datos_fin(1040) <= datos(1040); datos_fin(1041) <= datos(1041); datos_fin(1042) <= datos(1042); datos_fin(1043) <= datos(1043); datos_fin(1044) <= datos(1044); datos_fin(1045) <= datos(1045); datos_fin(1046) <= datos(1046); datos_fin(1047) <= datos(1047); datos_fin(1048) <= datos(1048); datos_fin(1049) <= datos(1049); datos_fin(1050) <= datos(1050); datos_fin(1051) <= datos(1051); datos_fin(1052) <= datos(1052); datos_fin(1053) <= datos(1053); datos_fin(1054) <= datos(1054); datos_fin(1055) <= datos(1055); datos_fin(1056) <= datos(1056); 
datos_fin(1057) <= datos(1057); datos_fin(1058) <= datos(1058); datos_fin(1059) <= datos(1059); datos_fin(1060) <= datos(1060); datos_fin(1061) <= datos(1061); datos_fin(1062) <= datos(1062); datos_fin(1063) <= datos(1063); datos_fin(1064) <= datos(1064); datos_fin(1065) <= datos(1065); datos_fin(1066) <= datos(1066); datos_fin(1067) <= datos(1067); datos_fin(1068) <= datos(1068); datos_fin(1069) <= datos(1069); datos_fin(1070) <= datos(1070); datos_fin(1071) <= datos(1071); datos_fin(1072) <= datos(1072); datos_fin(1073) <= datos(1073); datos_fin(1074) <= datos(1074); datos_fin(1075) <= datos(1075); datos_fin(1076) <= datos(1076); datos_fin(1077) <= datos(1077); datos_fin(1078) <= datos(1078); datos_fin(1079) <= datos(1079); datos_fin(1080) <= datos(1080); datos_fin(1081) <= datos(1081); datos_fin(1082) <= datos(1082); datos_fin(1083) <= datos(1083); datos_fin(1084) <= datos(1084); datos_fin(1085) <= datos(1085); datos_fin(1086) <= datos(1086); datos_fin(1087) <= datos(1087); datos_fin(1088) <= datos(1088); 
datos_fin(1089) <= datos(1089); datos_fin(1090) <= datos(1090); datos_fin(1091) <= datos(1091); datos_fin(1092) <= datos(1092); datos_fin(1093) <= datos(1093); datos_fin(1094) <= datos(1094); datos_fin(1095) <= datos(1095); datos_fin(1096) <= datos(1096); datos_fin(1097) <= datos(1097); datos_fin(1098) <= datos(1098); datos_fin(1099) <= datos(1099); datos_fin(1100) <= datos(1100); datos_fin(1101) <= datos(1101); datos_fin(1102) <= datos(1102); datos_fin(1103) <= datos(1103); datos_fin(1104) <= datos(1104); datos_fin(1105) <= datos(1105); datos_fin(1106) <= datos(1106); datos_fin(1107) <= datos(1107); datos_fin(1108) <= datos(1108); datos_fin(1109) <= datos(1109); datos_fin(1110) <= datos(1110); datos_fin(1111) <= datos(1111); datos_fin(1112) <= datos(1112); datos_fin(1113) <= datos(1113); datos_fin(1114) <= datos(1114); datos_fin(1115) <= datos(1115); datos_fin(1116) <= datos(1116); datos_fin(1117) <= datos(1117); datos_fin(1118) <= datos(1118); datos_fin(1119) <= datos(1119); datos_fin(1120) <= datos(1120); 
datos_fin(1121) <= datos(1121); datos_fin(1122) <= datos(1122); datos_fin(1123) <= datos(1123); datos_fin(1124) <= datos(1124); datos_fin(1125) <= datos(1125); datos_fin(1126) <= datos(1126); datos_fin(1127) <= datos(1127); datos_fin(1128) <= datos(1128); datos_fin(1129) <= datos(1129); datos_fin(1130) <= datos(1130); datos_fin(1131) <= datos(1131); datos_fin(1132) <= datos(1132); datos_fin(1133) <= datos(1133); datos_fin(1134) <= datos(1134); datos_fin(1135) <= datos(1135); datos_fin(1136) <= datos(1136); datos_fin(1137) <= datos(1137); datos_fin(1138) <= datos(1138); datos_fin(1139) <= datos(1139); datos_fin(1140) <= datos(1140); datos_fin(1141) <= datos(1141); datos_fin(1142) <= datos(1142); datos_fin(1143) <= datos(1143); datos_fin(1144) <= datos(1144); datos_fin(1145) <= datos(1145); datos_fin(1146) <= datos(1146); datos_fin(1147) <= datos(1147); datos_fin(1148) <= datos(1148); datos_fin(1149) <= datos(1149); datos_fin(1150) <= datos(1150); datos_fin(1151) <= datos(1151); datos_fin(1152) <= datos(1152); 
datos_fin(1153) <= datos(1153); datos_fin(1154) <= datos(1154); datos_fin(1155) <= datos(1155); datos_fin(1156) <= datos(1156); datos_fin(1157) <= datos(1157); datos_fin(1158) <= datos(1158); datos_fin(1159) <= datos(1159); datos_fin(1160) <= datos(1160); datos_fin(1161) <= datos(1161); datos_fin(1162) <= datos(1162); datos_fin(1163) <= datos(1163); datos_fin(1164) <= datos(1164); datos_fin(1165) <= datos(1165); datos_fin(1166) <= datos(1166); datos_fin(1167) <= datos(1167); datos_fin(1168) <= datos(1168); datos_fin(1169) <= datos(1169); datos_fin(1170) <= datos(1170); datos_fin(1171) <= datos(1171); datos_fin(1172) <= datos(1172); datos_fin(1173) <= datos(1173); datos_fin(1174) <= datos(1174); datos_fin(1175) <= datos(1175); datos_fin(1176) <= datos(1176); datos_fin(1177) <= datos(1177); datos_fin(1178) <= datos(1178); datos_fin(1179) <= datos(1179); datos_fin(1180) <= datos(1180); datos_fin(1181) <= datos(1181); datos_fin(1182) <= datos(1182); datos_fin(1183) <= datos(1183); datos_fin(1184) <= datos(1184); 
datos_fin(1185) <= datos(1185); datos_fin(1186) <= datos(1186); datos_fin(1187) <= datos(1187); datos_fin(1188) <= datos(1188); datos_fin(1189) <= datos(1189); datos_fin(1190) <= datos(1190); datos_fin(1191) <= datos(1191); datos_fin(1192) <= datos(1192); datos_fin(1193) <= datos(1193); datos_fin(1194) <= datos(1194); datos_fin(1195) <= datos(1195); datos_fin(1196) <= datos(1196); datos_fin(1197) <= datos(1197); datos_fin(1198) <= datos(1198); datos_fin(1199) <= datos(1199); datos_fin(1200) <= datos(1200); datos_fin(1201) <= datos(1201); datos_fin(1202) <= datos(1202); datos_fin(1203) <= datos(1203); datos_fin(1204) <= datos(1204); datos_fin(1205) <= datos(1205); datos_fin(1206) <= datos(1206); datos_fin(1207) <= datos(1207); datos_fin(1208) <= datos(1208); datos_fin(1209) <= datos(1209); datos_fin(1210) <= datos(1210); datos_fin(1211) <= datos(1211); datos_fin(1212) <= datos(1212); datos_fin(1213) <= datos(1213); datos_fin(1214) <= datos(1214); datos_fin(1215) <= datos(1215); datos_fin(1216) <= datos(1216); 
datos_fin(1217) <= datos(1217); datos_fin(1218) <= datos(1218); datos_fin(1219) <= datos(1219); datos_fin(1220) <= datos(1220); datos_fin(1221) <= datos(1221); datos_fin(1222) <= datos(1222); datos_fin(1223) <= datos(1223); datos_fin(1224) <= datos(1224); datos_fin(1225) <= datos(1225); datos_fin(1226) <= datos(1226); datos_fin(1227) <= datos(1227); datos_fin(1228) <= datos(1228); datos_fin(1229) <= datos(1229); datos_fin(1230) <= datos(1230); datos_fin(1231) <= datos(1231); datos_fin(1232) <= datos(1232); datos_fin(1233) <= datos(1233); datos_fin(1234) <= datos(1234); datos_fin(1235) <= datos(1235); datos_fin(1236) <= datos(1236); datos_fin(1237) <= datos(1237); datos_fin(1238) <= datos(1238); datos_fin(1239) <= datos(1239); datos_fin(1240) <= datos(1240); datos_fin(1241) <= datos(1241); datos_fin(1242) <= datos(1242); datos_fin(1243) <= datos(1243); datos_fin(1244) <= datos(1244); datos_fin(1245) <= datos(1245); datos_fin(1246) <= datos(1246); datos_fin(1247) <= datos(1247); datos_fin(1248) <= datos(1248); 
datos_fin(1249) <= datos(1249); datos_fin(1250) <= datos(1250); datos_fin(1251) <= datos(1251); datos_fin(1252) <= datos(1252); datos_fin(1253) <= datos(1253); datos_fin(1254) <= datos(1254); datos_fin(1255) <= datos(1255); datos_fin(1256) <= datos(1256); datos_fin(1257) <= datos(1257); datos_fin(1258) <= datos(1258); datos_fin(1259) <= datos(1259); datos_fin(1260) <= datos(1260); datos_fin(1261) <= datos(1261); datos_fin(1262) <= datos(1262); datos_fin(1263) <= datos(1263); datos_fin(1264) <= datos(1264); datos_fin(1265) <= datos(1265); datos_fin(1266) <= datos(1266); datos_fin(1267) <= datos(1267); datos_fin(1268) <= datos(1268); datos_fin(1269) <= datos(1269); datos_fin(1270) <= datos(1270); datos_fin(1271) <= datos(1271); datos_fin(1272) <= datos(1272); datos_fin(1273) <= datos(1273); datos_fin(1274) <= datos(1274); datos_fin(1275) <= datos(1275); datos_fin(1276) <= datos(1276); datos_fin(1277) <= datos(1277); datos_fin(1278) <= datos(1278); datos_fin(1279) <= datos(1279); datos_fin(1280) <= datos(1280); 
datos_fin(1281) <= datos(1281); datos_fin(1282) <= datos(1282); datos_fin(1283) <= datos(1283); datos_fin(1284) <= datos(1284); datos_fin(1285) <= datos(1285); datos_fin(1286) <= datos(1286); datos_fin(1287) <= datos(1287); datos_fin(1288) <= datos(1288); datos_fin(1289) <= datos(1289); datos_fin(1290) <= datos(1290); datos_fin(1291) <= datos(1291); datos_fin(1292) <= datos(1292); datos_fin(1293) <= datos(1293); datos_fin(1294) <= datos(1294); datos_fin(1295) <= datos(1295); datos_fin(1296) <= datos(1296); datos_fin(1297) <= datos(1297); datos_fin(1298) <= datos(1298); datos_fin(1299) <= datos(1299); datos_fin(1300) <= datos(1300); datos_fin(1301) <= datos(1301); datos_fin(1302) <= datos(1302); datos_fin(1303) <= datos(1303); datos_fin(1304) <= datos(1304); datos_fin(1305) <= datos(1305); datos_fin(1306) <= datos(1306); datos_fin(1307) <= datos(1307); datos_fin(1308) <= datos(1308); datos_fin(1309) <= datos(1309); datos_fin(1310) <= datos(1310); datos_fin(1311) <= datos(1311); datos_fin(1312) <= datos(1312); 
datos_fin(1313) <= datos(1313); datos_fin(1314) <= datos(1314); datos_fin(1315) <= datos(1315); datos_fin(1316) <= datos(1316); datos_fin(1317) <= datos(1317); datos_fin(1318) <= datos(1318); datos_fin(1319) <= datos(1319); datos_fin(1320) <= datos(1320); datos_fin(1321) <= datos(1321); datos_fin(1322) <= datos(1322); datos_fin(1323) <= datos(1323); datos_fin(1324) <= datos(1324); datos_fin(1325) <= datos(1325); datos_fin(1326) <= datos(1326); datos_fin(1327) <= datos(1327); datos_fin(1328) <= datos(1328); datos_fin(1329) <= datos(1329); datos_fin(1330) <= datos(1330); datos_fin(1331) <= datos(1331); datos_fin(1332) <= datos(1332); datos_fin(1333) <= datos(1333); datos_fin(1334) <= datos(1334); datos_fin(1335) <= datos(1335); datos_fin(1336) <= datos(1336); datos_fin(1337) <= datos(1337); datos_fin(1338) <= datos(1338); datos_fin(1339) <= datos(1339); datos_fin(1340) <= datos(1340); datos_fin(1341) <= datos(1341); datos_fin(1342) <= datos(1342); datos_fin(1343) <= datos(1343); datos_fin(1344) <= datos(1344); 
datos_fin(1345) <= datos(1345); datos_fin(1346) <= datos(1346); datos_fin(1347) <= datos(1347); datos_fin(1348) <= datos(1348); datos_fin(1349) <= datos(1349); datos_fin(1350) <= datos(1350); datos_fin(1351) <= datos(1351); datos_fin(1352) <= datos(1352); datos_fin(1353) <= datos(1353); datos_fin(1354) <= datos(1354); datos_fin(1355) <= datos(1355); datos_fin(1356) <= datos(1356); datos_fin(1357) <= datos(1357); datos_fin(1358) <= datos(1358); datos_fin(1359) <= datos(1359); datos_fin(1360) <= datos(1360); datos_fin(1361) <= datos(1361); datos_fin(1362) <= datos(1362); datos_fin(1363) <= datos(1363); datos_fin(1364) <= datos(1364); datos_fin(1365) <= datos(1365); datos_fin(1366) <= datos(1366); datos_fin(1367) <= datos(1367); datos_fin(1368) <= datos(1368); datos_fin(1369) <= datos(1369); datos_fin(1370) <= datos(1370); datos_fin(1371) <= datos(1371); datos_fin(1372) <= datos(1372); datos_fin(1373) <= datos(1373); datos_fin(1374) <= datos(1374); datos_fin(1375) <= datos(1375); datos_fin(1376) <= datos(1376); 
datos_fin(1377) <= datos(1377); datos_fin(1378) <= datos(1378); datos_fin(1379) <= datos(1379); datos_fin(1380) <= datos(1380); datos_fin(1381) <= datos(1381); datos_fin(1382) <= datos(1382); datos_fin(1383) <= datos(1383); datos_fin(1384) <= datos(1384); datos_fin(1385) <= datos(1385); datos_fin(1386) <= datos(1386); datos_fin(1387) <= datos(1387); datos_fin(1388) <= datos(1388); datos_fin(1389) <= datos(1389); datos_fin(1390) <= datos(1390); datos_fin(1391) <= datos(1391); datos_fin(1392) <= datos(1392); datos_fin(1393) <= datos(1393); datos_fin(1394) <= datos(1394); datos_fin(1395) <= datos(1395); datos_fin(1396) <= datos(1396); datos_fin(1397) <= datos(1397); datos_fin(1398) <= datos(1398); datos_fin(1399) <= datos(1399); datos_fin(1400) <= datos(1400); datos_fin(1401) <= datos(1401); datos_fin(1402) <= datos(1402); datos_fin(1403) <= datos(1403); datos_fin(1404) <= datos(1404); datos_fin(1405) <= datos(1405); datos_fin(1406) <= datos(1406); datos_fin(1407) <= datos(1407); datos_fin(1408) <= datos(1408); 
datos_fin(1409) <= datos(1409); datos_fin(1410) <= datos(1410); datos_fin(1411) <= datos(1411); datos_fin(1412) <= datos(1412); datos_fin(1413) <= datos(1413); datos_fin(1414) <= datos(1414); datos_fin(1415) <= datos(1415); datos_fin(1416) <= datos(1416); datos_fin(1417) <= datos(1417); datos_fin(1418) <= datos(1418); datos_fin(1419) <= datos(1419); datos_fin(1420) <= datos(1420); datos_fin(1421) <= datos(1421); datos_fin(1422) <= datos(1422); datos_fin(1423) <= datos(1423); datos_fin(1424) <= datos(1424); datos_fin(1425) <= datos(1425); datos_fin(1426) <= datos(1426); datos_fin(1427) <= datos(1427); datos_fin(1428) <= datos(1428); datos_fin(1429) <= datos(1429); datos_fin(1430) <= datos(1430); datos_fin(1431) <= datos(1431); datos_fin(1432) <= datos(1432); datos_fin(1433) <= datos(1433); datos_fin(1434) <= datos(1434); datos_fin(1435) <= datos(1435); datos_fin(1436) <= datos(1436); datos_fin(1437) <= datos(1437); datos_fin(1438) <= datos(1438); datos_fin(1439) <= datos(1439); datos_fin(1440) <= datos(1440); 
datos_fin(1441) <= datos(1441); datos_fin(1442) <= datos(1442); datos_fin(1443) <= datos(1443); datos_fin(1444) <= datos(1444); datos_fin(1445) <= datos(1445); datos_fin(1446) <= datos(1446); datos_fin(1447) <= datos(1447); datos_fin(1448) <= datos(1448); datos_fin(1449) <= datos(1449); datos_fin(1450) <= datos(1450); datos_fin(1451) <= datos(1451); datos_fin(1452) <= datos(1452); datos_fin(1453) <= datos(1453); datos_fin(1454) <= datos(1454); datos_fin(1455) <= datos(1455); datos_fin(1456) <= datos(1456); datos_fin(1457) <= datos(1457); datos_fin(1458) <= datos(1458); datos_fin(1459) <= datos(1459); datos_fin(1460) <= datos(1460); datos_fin(1461) <= datos(1461); datos_fin(1462) <= datos(1462); datos_fin(1463) <= datos(1463); datos_fin(1464) <= datos(1464); datos_fin(1465) <= datos(1465); datos_fin(1466) <= datos(1466); datos_fin(1467) <= datos(1467); datos_fin(1468) <= datos(1468); datos_fin(1469) <= datos(1469); datos_fin(1470) <= datos(1470); datos_fin(1471) <= datos(1471); datos_fin(1472) <= datos(1472); 
datos_fin(1473) <= datos(1473); datos_fin(1474) <= datos(1474); datos_fin(1475) <= datos(1475); datos_fin(1476) <= datos(1476); datos_fin(1477) <= datos(1477); datos_fin(1478) <= datos(1478); datos_fin(1479) <= datos(1479); datos_fin(1480) <= datos(1480); datos_fin(1481) <= datos(1481); datos_fin(1482) <= datos(1482); datos_fin(1483) <= datos(1483); datos_fin(1484) <= datos(1484); datos_fin(1485) <= datos(1485); datos_fin(1486) <= datos(1486); datos_fin(1487) <= datos(1487); datos_fin(1488) <= datos(1488); datos_fin(1489) <= datos(1489); datos_fin(1490) <= datos(1490); datos_fin(1491) <= datos(1491); datos_fin(1492) <= datos(1492); datos_fin(1493) <= datos(1493); datos_fin(1494) <= datos(1494); datos_fin(1495) <= datos(1495); datos_fin(1496) <= datos(1496); datos_fin(1497) <= datos(1497); datos_fin(1498) <= datos(1498); datos_fin(1499) <= datos(1499); datos_fin(1500) <= datos(1500); datos_fin(1501) <= datos(1501); datos_fin(1502) <= datos(1502); datos_fin(1503) <= datos(1503); datos_fin(1504) <= datos(1504); 
datos_fin(1505) <= datos(1505); datos_fin(1506) <= datos(1506); datos_fin(1507) <= datos(1507); datos_fin(1508) <= datos(1508); datos_fin(1509) <= datos(1509); datos_fin(1510) <= datos(1510); datos_fin(1511) <= datos(1511); datos_fin(1512) <= datos(1512); datos_fin(1513) <= datos(1513); datos_fin(1514) <= datos(1514); datos_fin(1515) <= datos(1515); datos_fin(1516) <= datos(1516); datos_fin(1517) <= datos(1517); datos_fin(1518) <= datos(1518); datos_fin(1519) <= datos(1519); datos_fin(1520) <= datos(1520); datos_fin(1521) <= datos(1521); datos_fin(1522) <= datos(1522); datos_fin(1523) <= datos(1523); datos_fin(1524) <= datos(1524); datos_fin(1525) <= datos(1525); datos_fin(1526) <= datos(1526); datos_fin(1527) <= datos(1527); datos_fin(1528) <= datos(1528); datos_fin(1529) <= datos(1529); datos_fin(1530) <= datos(1530); datos_fin(1531) <= datos(1531); datos_fin(1532) <= datos(1532); datos_fin(1533) <= datos(1533); datos_fin(1534) <= datos(1534); datos_fin(1535) <= datos(1535); datos_fin(1536) <= datos(1536); 
datos_fin(1537) <= datos(1537); datos_fin(1538) <= datos(1538); datos_fin(1539) <= datos(1539); datos_fin(1540) <= datos(1540); datos_fin(1541) <= datos(1541); datos_fin(1542) <= datos(1542); datos_fin(1543) <= datos(1543); datos_fin(1544) <= datos(1544); datos_fin(1545) <= datos(1545); datos_fin(1546) <= datos(1546); datos_fin(1547) <= datos(1547); datos_fin(1548) <= datos(1548); datos_fin(1549) <= datos(1549); datos_fin(1550) <= datos(1550); datos_fin(1551) <= datos(1551); datos_fin(1552) <= datos(1552); datos_fin(1553) <= datos(1553); datos_fin(1554) <= datos(1554); datos_fin(1555) <= datos(1555); datos_fin(1556) <= datos(1556); datos_fin(1557) <= datos(1557); datos_fin(1558) <= datos(1558); datos_fin(1559) <= datos(1559); datos_fin(1560) <= datos(1560); datos_fin(1561) <= datos(1561); datos_fin(1562) <= datos(1562); datos_fin(1563) <= datos(1563); datos_fin(1564) <= datos(1564); datos_fin(1565) <= datos(1565); datos_fin(1566) <= datos(1566); datos_fin(1567) <= datos(1567); datos_fin(1568) <= datos(1568); 
datos_fin(1569) <= datos(1569); datos_fin(1570) <= datos(1570); datos_fin(1571) <= datos(1571); datos_fin(1572) <= datos(1572); datos_fin(1573) <= datos(1573); datos_fin(1574) <= datos(1574); datos_fin(1575) <= datos(1575); datos_fin(1576) <= datos(1576); datos_fin(1577) <= datos(1577); datos_fin(1578) <= datos(1578); datos_fin(1579) <= datos(1579); datos_fin(1580) <= datos(1580); datos_fin(1581) <= datos(1581); datos_fin(1582) <= datos(1582); datos_fin(1583) <= datos(1583); datos_fin(1584) <= datos(1584); datos_fin(1585) <= datos(1585); datos_fin(1586) <= datos(1586); datos_fin(1587) <= datos(1587); datos_fin(1588) <= datos(1588); datos_fin(1589) <= datos(1589); datos_fin(1590) <= datos(1590); datos_fin(1591) <= datos(1591); datos_fin(1592) <= datos(1592); datos_fin(1593) <= datos(1593); datos_fin(1594) <= datos(1594); datos_fin(1595) <= datos(1595); datos_fin(1596) <= datos(1596); datos_fin(1597) <= datos(1597); datos_fin(1598) <= datos(1598); datos_fin(1599) <= datos(1599); datos_fin(1600) <= datos(1600); 
datos_fin(1601) <= datos(1601); datos_fin(1602) <= datos(1602); datos_fin(1603) <= datos(1603); datos_fin(1604) <= datos(1604); datos_fin(1605) <= datos(1605); datos_fin(1606) <= datos(1606); datos_fin(1607) <= datos(1607); datos_fin(1608) <= datos(1608); datos_fin(1609) <= datos(1609); datos_fin(1610) <= datos(1610); datos_fin(1611) <= datos(1611); datos_fin(1612) <= datos(1612); datos_fin(1613) <= datos(1613); datos_fin(1614) <= datos(1614); datos_fin(1615) <= datos(1615); datos_fin(1616) <= datos(1616); datos_fin(1617) <= datos(1617); datos_fin(1618) <= datos(1618); datos_fin(1619) <= datos(1619); datos_fin(1620) <= datos(1620); datos_fin(1621) <= datos(1621); datos_fin(1622) <= datos(1622); datos_fin(1623) <= datos(1623); datos_fin(1624) <= datos(1624); datos_fin(1625) <= datos(1625); datos_fin(1626) <= datos(1626); datos_fin(1627) <= datos(1627); datos_fin(1628) <= datos(1628); datos_fin(1629) <= datos(1629); datos_fin(1630) <= datos(1630); datos_fin(1631) <= datos(1631); datos_fin(1632) <= datos(1632); 
datos_fin(1633) <= datos(1633); datos_fin(1634) <= datos(1634); datos_fin(1635) <= datos(1635); datos_fin(1636) <= datos(1636); datos_fin(1637) <= datos(1637); datos_fin(1638) <= datos(1638); datos_fin(1639) <= datos(1639); datos_fin(1640) <= datos(1640); datos_fin(1641) <= datos(1641); datos_fin(1642) <= datos(1642); datos_fin(1643) <= datos(1643); datos_fin(1644) <= datos(1644); datos_fin(1645) <= datos(1645); datos_fin(1646) <= datos(1646); datos_fin(1647) <= datos(1647); datos_fin(1648) <= datos(1648); datos_fin(1649) <= datos(1649); datos_fin(1650) <= datos(1650); datos_fin(1651) <= datos(1651); datos_fin(1652) <= datos(1652); datos_fin(1653) <= datos(1653); datos_fin(1654) <= datos(1654); datos_fin(1655) <= datos(1655); datos_fin(1656) <= datos(1656); datos_fin(1657) <= datos(1657); datos_fin(1658) <= datos(1658); datos_fin(1659) <= datos(1659); datos_fin(1660) <= datos(1660); datos_fin(1661) <= datos(1661); datos_fin(1662) <= datos(1662); datos_fin(1663) <= datos(1663); datos_fin(1664) <= datos(1664); 
datos_fin(1665) <= datos(1665); datos_fin(1666) <= datos(1666); datos_fin(1667) <= datos(1667); datos_fin(1668) <= datos(1668); datos_fin(1669) <= datos(1669); datos_fin(1670) <= datos(1670); datos_fin(1671) <= datos(1671); datos_fin(1672) <= datos(1672); datos_fin(1673) <= datos(1673); datos_fin(1674) <= datos(1674); datos_fin(1675) <= datos(1675); datos_fin(1676) <= datos(1676); datos_fin(1677) <= datos(1677); datos_fin(1678) <= datos(1678); datos_fin(1679) <= datos(1679); datos_fin(1680) <= datos(1680); datos_fin(1681) <= datos(1681); datos_fin(1682) <= datos(1682); datos_fin(1683) <= datos(1683); datos_fin(1684) <= datos(1684); datos_fin(1685) <= datos(1685); datos_fin(1686) <= datos(1686); datos_fin(1687) <= datos(1687); datos_fin(1688) <= datos(1688); datos_fin(1689) <= datos(1689); datos_fin(1690) <= datos(1690); datos_fin(1691) <= datos(1691); datos_fin(1692) <= datos(1692); datos_fin(1693) <= datos(1693); datos_fin(1694) <= datos(1694); datos_fin(1695) <= datos(1695); datos_fin(1696) <= datos(1696); 
datos_fin(1697) <= datos(1697); datos_fin(1698) <= datos(1698); datos_fin(1699) <= datos(1699); datos_fin(1700) <= datos(1700); datos_fin(1701) <= datos(1701); datos_fin(1702) <= datos(1702); datos_fin(1703) <= datos(1703); datos_fin(1704) <= datos(1704); datos_fin(1705) <= datos(1705); datos_fin(1706) <= datos(1706); datos_fin(1707) <= datos(1707); datos_fin(1708) <= datos(1708); datos_fin(1709) <= datos(1709); datos_fin(1710) <= datos(1710); datos_fin(1711) <= datos(1711); datos_fin(1712) <= datos(1712); datos_fin(1713) <= datos(1713); datos_fin(1714) <= datos(1714); datos_fin(1715) <= datos(1715); datos_fin(1716) <= datos(1716); datos_fin(1717) <= datos(1717); datos_fin(1718) <= datos(1718); datos_fin(1719) <= datos(1719); datos_fin(1720) <= datos(1720); datos_fin(1721) <= datos(1721); datos_fin(1722) <= datos(1722); datos_fin(1723) <= datos(1723); datos_fin(1724) <= datos(1724); datos_fin(1725) <= datos(1725); datos_fin(1726) <= datos(1726); datos_fin(1727) <= datos(1727); datos_fin(1728) <= datos(1728); 
datos_fin(1729) <= datos(1729); datos_fin(1730) <= datos(1730); datos_fin(1731) <= datos(1731); datos_fin(1732) <= datos(1732); datos_fin(1733) <= datos(1733); datos_fin(1734) <= datos(1734); datos_fin(1735) <= datos(1735); datos_fin(1736) <= datos(1736); datos_fin(1737) <= datos(1737); datos_fin(1738) <= datos(1738); datos_fin(1739) <= datos(1739); datos_fin(1740) <= datos(1740); datos_fin(1741) <= datos(1741); datos_fin(1742) <= datos(1742); datos_fin(1743) <= datos(1743); datos_fin(1744) <= datos(1744); datos_fin(1745) <= datos(1745); datos_fin(1746) <= datos(1746); datos_fin(1747) <= datos(1747); datos_fin(1748) <= datos(1748); datos_fin(1749) <= datos(1749); datos_fin(1750) <= datos(1750); datos_fin(1751) <= datos(1751); datos_fin(1752) <= datos(1752); datos_fin(1753) <= datos(1753); datos_fin(1754) <= datos(1754); datos_fin(1755) <= datos(1755); datos_fin(1756) <= datos(1756); datos_fin(1757) <= datos(1757); datos_fin(1758) <= datos(1758); datos_fin(1759) <= datos(1759); datos_fin(1760) <= datos(1760); 
datos_fin(1761) <= datos(1761); datos_fin(1762) <= datos(1762); datos_fin(1763) <= datos(1763); datos_fin(1764) <= datos(1764); datos_fin(1765) <= datos(1765); datos_fin(1766) <= datos(1766); datos_fin(1767) <= datos(1767); datos_fin(1768) <= datos(1768); datos_fin(1769) <= datos(1769); datos_fin(1770) <= datos(1770); datos_fin(1771) <= datos(1771); datos_fin(1772) <= datos(1772); datos_fin(1773) <= datos(1773); datos_fin(1774) <= datos(1774); datos_fin(1775) <= datos(1775); datos_fin(1776) <= datos(1776); datos_fin(1777) <= datos(1777); datos_fin(1778) <= datos(1778); datos_fin(1779) <= datos(1779); datos_fin(1780) <= datos(1780); datos_fin(1781) <= datos(1781); datos_fin(1782) <= datos(1782); datos_fin(1783) <= datos(1783); datos_fin(1784) <= datos(1784); datos_fin(1785) <= datos(1785); datos_fin(1786) <= datos(1786); datos_fin(1787) <= datos(1787); datos_fin(1788) <= datos(1788); datos_fin(1789) <= datos(1789); datos_fin(1790) <= datos(1790); datos_fin(1791) <= datos(1791); datos_fin(1792) <= datos(1792); 
datos_fin(1793) <= datos(1793); datos_fin(1794) <= datos(1794); datos_fin(1795) <= datos(1795); datos_fin(1796) <= datos(1796); datos_fin(1797) <= datos(1797); datos_fin(1798) <= datos(1798); datos_fin(1799) <= datos(1799); datos_fin(1800) <= datos(1800); datos_fin(1801) <= datos(1801); datos_fin(1802) <= datos(1802); datos_fin(1803) <= datos(1803); datos_fin(1804) <= datos(1804); datos_fin(1805) <= datos(1805); datos_fin(1806) <= datos(1806); datos_fin(1807) <= datos(1807); datos_fin(1808) <= datos(1808); datos_fin(1809) <= datos(1809); datos_fin(1810) <= datos(1810); datos_fin(1811) <= datos(1811); datos_fin(1812) <= datos(1812); datos_fin(1813) <= datos(1813); datos_fin(1814) <= datos(1814); datos_fin(1815) <= datos(1815); datos_fin(1816) <= datos(1816); datos_fin(1817) <= datos(1817); datos_fin(1818) <= datos(1818); datos_fin(1819) <= datos(1819); datos_fin(1820) <= datos(1820); datos_fin(1821) <= datos(1821); datos_fin(1822) <= datos(1822); datos_fin(1823) <= datos(1823); datos_fin(1824) <= datos(1824); 
datos_fin(1825) <= datos(1825); datos_fin(1826) <= datos(1826); datos_fin(1827) <= datos(1827); datos_fin(1828) <= datos(1828); datos_fin(1829) <= datos(1829); datos_fin(1830) <= datos(1830); datos_fin(1831) <= datos(1831); datos_fin(1832) <= datos(1832); datos_fin(1833) <= datos(1833); datos_fin(1834) <= datos(1834); datos_fin(1835) <= datos(1835); datos_fin(1836) <= datos(1836); datos_fin(1837) <= datos(1837); datos_fin(1838) <= datos(1838); datos_fin(1839) <= datos(1839); datos_fin(1840) <= datos(1840); datos_fin(1841) <= datos(1841); datos_fin(1842) <= datos(1842); datos_fin(1843) <= datos(1843); datos_fin(1844) <= datos(1844); datos_fin(1845) <= datos(1845); datos_fin(1846) <= datos(1846); datos_fin(1847) <= datos(1847); datos_fin(1848) <= datos(1848); datos_fin(1849) <= datos(1849); datos_fin(1850) <= datos(1850); datos_fin(1851) <= datos(1851); datos_fin(1852) <= datos(1852); datos_fin(1853) <= datos(1853); datos_fin(1854) <= datos(1854); datos_fin(1855) <= datos(1855); datos_fin(1856) <= datos(1856); 
datos_fin(1857) <= datos(1857); datos_fin(1858) <= datos(1858); datos_fin(1859) <= datos(1859); datos_fin(1860) <= datos(1860); datos_fin(1861) <= datos(1861); datos_fin(1862) <= datos(1862); datos_fin(1863) <= datos(1863); datos_fin(1864) <= datos(1864); datos_fin(1865) <= datos(1865); datos_fin(1866) <= datos(1866); datos_fin(1867) <= datos(1867); datos_fin(1868) <= datos(1868); datos_fin(1869) <= datos(1869); datos_fin(1870) <= datos(1870); datos_fin(1871) <= datos(1871); datos_fin(1872) <= datos(1872); datos_fin(1873) <= datos(1873); datos_fin(1874) <= datos(1874); datos_fin(1875) <= datos(1875); datos_fin(1876) <= datos(1876); datos_fin(1877) <= datos(1877); datos_fin(1878) <= datos(1878); datos_fin(1879) <= datos(1879); datos_fin(1880) <= datos(1880); datos_fin(1881) <= datos(1881); datos_fin(1882) <= datos(1882); datos_fin(1883) <= datos(1883); datos_fin(1884) <= datos(1884); datos_fin(1885) <= datos(1885); datos_fin(1886) <= datos(1886); datos_fin(1887) <= datos(1887); datos_fin(1888) <= datos(1888); 
datos_fin(1889) <= datos(1889); datos_fin(1890) <= datos(1890); datos_fin(1891) <= datos(1891); datos_fin(1892) <= datos(1892); datos_fin(1893) <= datos(1893); datos_fin(1894) <= datos(1894); datos_fin(1895) <= datos(1895); datos_fin(1896) <= datos(1896); datos_fin(1897) <= datos(1897); datos_fin(1898) <= datos(1898); datos_fin(1899) <= datos(1899); datos_fin(1900) <= datos(1900); datos_fin(1901) <= datos(1901); datos_fin(1902) <= datos(1902); datos_fin(1903) <= datos(1903); datos_fin(1904) <= datos(1904); datos_fin(1905) <= datos(1905); datos_fin(1906) <= datos(1906); datos_fin(1907) <= datos(1907); datos_fin(1908) <= datos(1908); datos_fin(1909) <= datos(1909); datos_fin(1910) <= datos(1910); datos_fin(1911) <= datos(1911); datos_fin(1912) <= datos(1912); datos_fin(1913) <= datos(1913); datos_fin(1914) <= datos(1914); datos_fin(1915) <= datos(1915); datos_fin(1916) <= datos(1916); datos_fin(1917) <= datos(1917); datos_fin(1918) <= datos(1918); datos_fin(1919) <= datos(1919); datos_fin(1920) <= datos(1920); 
datos_fin(1921) <= datos(1921); datos_fin(1922) <= datos(1922); datos_fin(1923) <= datos(1923); datos_fin(1924) <= datos(1924); datos_fin(1925) <= datos(1925); datos_fin(1926) <= datos(1926); datos_fin(1927) <= datos(1927); datos_fin(1928) <= datos(1928); datos_fin(1929) <= datos(1929); datos_fin(1930) <= datos(1930); datos_fin(1931) <= datos(1931); datos_fin(1932) <= datos(1932); datos_fin(1933) <= datos(1933); datos_fin(1934) <= datos(1934); datos_fin(1935) <= datos(1935); datos_fin(1936) <= datos(1936); datos_fin(1937) <= datos(1937); datos_fin(1938) <= datos(1938); datos_fin(1939) <= datos(1939); datos_fin(1940) <= datos(1940); datos_fin(1941) <= datos(1941); datos_fin(1942) <= datos(1942); datos_fin(1943) <= datos(1943); datos_fin(1944) <= datos(1944); datos_fin(1945) <= datos(1945); datos_fin(1946) <= datos(1946); datos_fin(1947) <= datos(1947); datos_fin(1948) <= datos(1948); datos_fin(1949) <= datos(1949); datos_fin(1950) <= datos(1950); datos_fin(1951) <= datos(1951); datos_fin(1952) <= datos(1952); 
datos_fin(1953) <= datos(1953); datos_fin(1954) <= datos(1954); datos_fin(1955) <= datos(1955); datos_fin(1956) <= datos(1956); datos_fin(1957) <= datos(1957); datos_fin(1958) <= datos(1958); datos_fin(1959) <= datos(1959); datos_fin(1960) <= datos(1960); datos_fin(1961) <= datos(1961); datos_fin(1962) <= datos(1962); datos_fin(1963) <= datos(1963); datos_fin(1964) <= datos(1964); datos_fin(1965) <= datos(1965); datos_fin(1966) <= datos(1966); datos_fin(1967) <= datos(1967); datos_fin(1968) <= datos(1968); datos_fin(1969) <= datos(1969); datos_fin(1970) <= datos(1970); datos_fin(1971) <= datos(1971); datos_fin(1972) <= datos(1972); datos_fin(1973) <= datos(1973); datos_fin(1974) <= datos(1974); datos_fin(1975) <= datos(1975); datos_fin(1976) <= datos(1976); datos_fin(1977) <= datos(1977); datos_fin(1978) <= datos(1978); datos_fin(1979) <= datos(1979); datos_fin(1980) <= datos(1980); datos_fin(1981) <= datos(1981); datos_fin(1982) <= datos(1982); datos_fin(1983) <= datos(1983); datos_fin(1984) <= datos(1984); 
datos_fin(1985) <= datos(1985); datos_fin(1986) <= datos(1986); datos_fin(1987) <= datos(1987); datos_fin(1988) <= datos(1988); datos_fin(1989) <= datos(1989); datos_fin(1990) <= datos(1990); datos_fin(1991) <= datos(1991); datos_fin(1992) <= datos(1992); datos_fin(1993) <= datos(1993); datos_fin(1994) <= datos(1994); datos_fin(1995) <= datos(1995); datos_fin(1996) <= datos(1996); datos_fin(1997) <= datos(1997); datos_fin(1998) <= datos(1998); datos_fin(1999) <= datos(1999); datos_fin(2000) <= datos(2000); datos_fin(2001) <= datos(2001); datos_fin(2002) <= datos(2002); datos_fin(2003) <= datos(2003); datos_fin(2004) <= datos(2004); datos_fin(2005) <= datos(2005); datos_fin(2006) <= datos(2006); datos_fin(2007) <= datos(2007); datos_fin(2008) <= datos(2008); datos_fin(2009) <= datos(2009); datos_fin(2010) <= datos(2010); datos_fin(2011) <= datos(2011); datos_fin(2012) <= datos(2012); datos_fin(2013) <= datos(2013); datos_fin(2014) <= datos(2014); datos_fin(2015) <= datos(2015); datos_fin(2016) <= datos(2016); 
datos_fin(2017) <= datos(2017); datos_fin(2018) <= datos(2018); datos_fin(2019) <= datos(2019); datos_fin(2020) <= datos(2020); datos_fin(2021) <= datos(2021); datos_fin(2022) <= datos(2022); datos_fin(2023) <= datos(2023); datos_fin(2024) <= datos(2024); datos_fin(2025) <= datos(2025); datos_fin(2026) <= datos(2026); datos_fin(2027) <= datos(2027); datos_fin(2028) <= datos(2028); datos_fin(2029) <= datos(2029); datos_fin(2030) <= datos(2030); datos_fin(2031) <= datos(2031); datos_fin(2032) <= datos(2032); datos_fin(2033) <= datos(2033); datos_fin(2034) <= datos(2034); datos_fin(2035) <= datos(2035); datos_fin(2036) <= datos(2036); datos_fin(2037) <= datos(2037); datos_fin(2038) <= datos(2038); datos_fin(2039) <= datos(2039); datos_fin(2040) <= datos(2040); datos_fin(2041) <= datos(2041); datos_fin(2042) <= datos(2042); datos_fin(2043) <= datos(2043); datos_fin(2044) <= datos(2044); datos_fin(2045) <= datos(2045); datos_fin(2046) <= datos(2046); datos_fin(2047) <= datos(2047); 
        end if;
      else 
        delay(0) <= xk_index;
        delay(1) <= delay(0);
        delay(2) <= delay(1);
        delay(3) <= delay(2);
        delay(4) <= delay(3);
        delay(5) <= delay(4);
        delay(6) <= delay(5);
        delay(7) <= delay(6);
        delay(8) <= delay(7);
        delay(9) <= delay(8);
        delay(10) <= delay(9);
        delay(11) <= delay(10);
        delay(12) <= delay(11);
        delay(13) <= delay(12);
        delay(14) <= delay(13);
        delay(15) <= delay(14);
        delay(16) <= delay(15);
        delay(17) <= delay(16);
        delay(18) <= delay(17);
        delay(19) <= delay(18);
        delay(20) <= delay(19);
        delay(21) <= delay(20);
        delay(22) <= delay(21);
        delay(23) <= delay(22);
        delay(24) <= delay(23);
        delay(25) <= delay(24);
        delay(26) <= delay(25);
        delay(27) <= delay(26);
  --        case state is
  --          when inicio =>
  --            fwd_inv_we <= '1';
  --            if(fwd_inv_we = '1') then
  --              state <= carga;
  --            end if;
  --          when carga =>
  --              fwd_inv_we <='0';
  --              start <= '1';
  --              unload <= '1';
  --          when descarga =>
  --              fwd_inv_we <='0';
  --         end case; 
      end if;
  end process MAIN;

   MODULO : entity work.modulo
    port map
    (
   	  x_in        => p3,
	    x_out       => x_out,
	    rdy         => rdy,
	    clk         => Bus2IP_Clk
     );
 
    MULT1 : entity work.multiplier1
    port map
    (
      clk        => Bus2IP_Clk,
      a          => xk_re,
      b          => xk_re,
      p          => p1
     );
 
    MULT2 : entity work.multiplier2
    port map
    (
      clk        => Bus2IP_Clk,
      a          => xk_im,
      b          => xk_im,
      p          => p2
     );
  
  XFFT_V6_0 : entity work.xfft_v6_0
    port map
    (
   	  fwd_inv_we  => fwd_inv_we,
   	  rfd         => rfd,
 	    start       => start,
	    fwd_inv     => fwd_inv,
	    dv          => dv,
	    unload      => unload,
	    done        => done,
	    clk         => Bus2IP_Clk,
	    busy        => busy,
   	  edone       => edone,
   	  xn_re       => xn_re,
   	  xk_im       => xk_im,
   	  xn_index    => xn_index,
   	  xk_re       => xk_re,
   	  xn_im       => xn_im,
   	  xk_index    => xk_index
     );
  ------------------------------------------
  -- Example code to read/write user logic slave model s/w accessible registers
  -- 
  -- Note:
  -- The example code presented here is to show you one way of reading/writing
  -- software accessible registers implemented in the user logic slave model.
  -- Each bit of the Bus2IP_WrCE/Bus2IP_RdCE signals is configured to correspond
  -- to one software accessible register by the top level template. For example,
  -- if you have four 32 bit software accessible registers in the user logic,
  -- you are basically operating on the following memory mapped registers:
  -- 
  --    Bus2IP_WrCE/Bus2IP_RdCE   Memory Mapped Register
  --                     "1000"   C_BASEADDR + 0x0
  --                     "0100"   C_BASEADDR + 0x4
  --                     "0010"   C_BASEADDR + 0x8
  --                     "0001"   C_BASEADDR + 0xC
  -- 
  ------------------------------------------
  slv_reg_write_sel <= Bus2IP_WrCE(0 to 2);
  slv_reg_read_sel  <= Bus2IP_RdCE(0 to 2);
  slv_write_ack     <= Bus2IP_WrCE(0) or Bus2IP_WrCE(1) or Bus2IP_WrCE(2);
  slv_read_ack      <= Bus2IP_RdCE(0) or Bus2IP_RdCE(1) or Bus2IP_RdCE(2);

  -- implement slave model software accessible register(s)
  SLAVE_REG_WRITE_PROC : process( Bus2IP_Clk ) is
  begin

    if Bus2IP_Clk'event and Bus2IP_Clk = '1' then
      if Bus2IP_Reset = '1' then
        slv_reg0 <= (others => '0');
        slv_reg1 <= (others => '0');
      else
        case slv_reg_write_sel is
          when "100" =>
            for byte_index in 0 to (C_SLV_DWIDTH/8)-1 loop
              if ( Bus2IP_BE(byte_index) = '1' ) then
                slv_reg0(byte_index*8 to byte_index*8+7) <= Bus2IP_Data(byte_index*8 to byte_index*8+7);
              end if;
            end loop;
          when "010" =>
            for byte_index in 0 to (C_SLV_DWIDTH/8)-1 loop
              if ( Bus2IP_BE(byte_index) = '1' ) then
                slv_reg1(byte_index*8 to byte_index*8+7) <= Bus2IP_Data(byte_index*8 to byte_index*8+7);
              end if;
            end loop;
          when others => null;
        end case;
      end if;
    end if;

  end process SLAVE_REG_WRITE_PROC;

  -- implement slave model software accessible register(s) read mux
  SLAVE_REG_READ_PROC : process( slv_reg_read_sel, slv_reg0, slv_reg1, slv_reg2 ) is
  begin

    case slv_reg_read_sel is
      when "100" => slv_ip2bus_data <= slv_reg0;
      when "010" => slv_ip2bus_data <= slv_reg1;
      when "001" => slv_ip2bus_data <= slv_reg2;
      when others => slv_ip2bus_data <= (others => '0');
    end case;

  end process SLAVE_REG_READ_PROC;

  ------------------------------------------
  -- Example code to drive IP to Bus signals
  ------------------------------------------
  IP2Bus_Data  <= slv_ip2bus_data when slv_read_ack = '1' else
                  (others => '0');

  IP2Bus_WrAck <= slv_write_ack;
  IP2Bus_RdAck <= slv_read_ack;
  IP2Bus_Error <= '0';

end IMP;
